本文整理汇总了PHP中ViewableData::castingObjectCreatorPair方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewableData::castingObjectCreatorPair方法的具体用法?PHP ViewableData::castingObjectCreatorPair怎么用?PHP ViewableData::castingObjectCreatorPair使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewableData
的用法示例。
在下文中一共展示了ViewableData::castingObjectCreatorPair方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildCastingHelperCache
/**
* A helper function used by castingHelperPair() to build the cache.
* @param array
*/
public function buildCastingHelperCache(&$cache)
{
$class = $this->class;
$classes = ClassInfo::ancestry($class);
foreach ($classes as $componentClass) {
if ($componentClass == "ViewableData") {
$isViewableData = true;
}
if ($componentClass == "DataObject") {
$isDataObject = true;
}
if (isset($isDataObject) && $isDataObject) {
$fields = eval("return {$componentClass}::\$db;");
if ($fields) {
foreach ($fields as $fieldName => $fieldSchema) {
$cache[$fieldName] = ViewableData::castingObjectCreatorPair($fieldSchema);
}
}
}
if (isset($isViewableData) && $isViewableData) {
$fields = eval("return {$componentClass}::\$casting;");
if ($fields) {
foreach ($fields as $fieldName => $fieldSchema) {
$cache[$fieldName] = ViewableData::castingObjectCreatorPair($fieldSchema);
}
}
}
}
}
示例2: buildCastingHelperCache
/**
* A helper function used by castingHelperPair() to build the cache.
* @param array
*/
public function buildCastingHelperCache(&$cache)
{
$class = $this->class ? $this->class : get_class($this);
$classes = ClassInfo::ancestry($class);
foreach ($classes as $componentClass) {
if ($componentClass == "ViewableData") {
$isViewableData = true;
}
if ($componentClass == "DataObject") {
$isDataObject = true;
}
if (isset($isDataObject) && $isDataObject) {
$fields = Object::uninherited_static($componentClass, 'db');
if ($fields) {
foreach ($fields as $fieldName => $fieldSchema) {
$cache[$fieldName] = ViewableData::castingObjectCreatorPair($fieldSchema);
}
}
}
if (isset($isViewableData) && $isViewableData) {
$fields = Object::uninherited_static($componentClass, 'casting');
if ($fields) {
foreach ($fields as $fieldName => $fieldSchema) {
$cache[$fieldName] = ViewableData::castingObjectCreatorPair($fieldSchema);
}
}
}
}
}