当前位置: 首页>>代码示例>>PHP>>正文


PHP Object_Abstract::getClass方法代码示例

本文整理汇总了PHP中Object_Abstract::getClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Object_Abstract::getClass方法的具体用法?PHP Object_Abstract::getClass怎么用?PHP Object_Abstract::getClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Object_Abstract的用法示例。


在下文中一共展示了Object_Abstract::getClass方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTreeNodeConfig

 /**
  * @param Object_Abstract $child
  * @return array
  */
 protected function getTreeNodeConfig($child)
 {
     $tmpObject = array("id" => $child->getId(), "text" => $child->getKey(), "type" => $child->getType(), "path" => $child->getFullPath(), "basePath" => $child->getPath(), "elementType" => "object", "locked" => $child->isLocked(), "lockOwner" => $child->getLocked() ? true : false);
     $tmpObject["isTarget"] = false;
     $tmpObject["allowDrop"] = false;
     $tmpObject["allowChildren"] = false;
     $tmpObject["leaf"] = $child->hasNoChilds();
     //        $tmpObject["iconCls"] = "pimcore_icon_object";
     $tmpObject["isTarget"] = true;
     $tmpObject["allowDrop"] = true;
     $tmpObject["allowChildren"] = true;
     $tmpObject["leaf"] = false;
     $tmpObject["cls"] = "";
     if ($child->getType() == "folder") {
         //            $tmpObject["iconCls"] = "pimcore_icon_folder";
         $tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId());
     } else {
         //assemble object preview URL
         $previewUrl = $child->getClass()->getPreviewUrl();
         if (!empty($previewUrl)) {
             $vars = get_object_vars($child);
             $assembled = true;
             foreach ($vars as $key => $value) {
                 if (!empty($value) && strpos($previewUrl, "%" . $key) !== false) {
                     $previewUrl = str_replace("%" . $key, urlencode($value), $previewUrl);
                 } else {
                     if (strpos($previewUrl, "%" . $key) !== false) {
                         $assembled = false;
                         break;
                     }
                 }
                 if ($assembled) {
                     $tmpObject['previewUrl'] = $previewUrl;
                 }
             }
         }
         $tmpObject["published"] = $child->isPublished();
         $tmpObject["className"] = $child->getClass()->getName();
         $tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId(), "text" => 'Type: ' . $child->getClass()->getName());
         if (!$child->isPublished()) {
             $tmpObject["cls"] .= "pimcore_unpublished ";
         }
         //            if ($child->getClass()->getIcon()) {
         //                unset($tmpObject["iconCls"]);
         //                $tmpObject["icon"] = $child->getClass()->getIcon();
         //            }
     }
     if ($child->getElementAdminStyle()->getElementIcon()) {
         $tmpObject["icon"] = $child->getO_elementAdminStyle()->getElementIcon();
     }
     if ($child->getElementAdminStyle()->getElementIconClass()) {
         $tmpObject["iconCls"] = $child->getO_elementAdminStyle()->getElementIconClass();
     }
     if ($child->getElementAdminStyle()->getElementCssClass()) {
         $tmpObject["cls"] .= $child->getO_elementAdminStyle()->getElementCssClass() . " ";
     }
     $tmpObject["expanded"] = $child->hasNoChilds();
     $tmpObject["permissions"] = $child->getUserPermissions($this->getUser());
     if ($child->isLocked()) {
         $tmpObject["cls"] .= "pimcore_treenode_locked ";
     }
     if ($child->getLocked()) {
         $tmpObject["cls"] .= "pimcore_treenode_lockOwner ";
     }
     return $tmpObject;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:70,代码来源:ObjectController.php

示例2: getTreeNodeConfig

 /**
  * @param Object_Abstract $child
  * @return array
  */
 protected function getTreeNodeConfig($child)
 {
     $tmpObject = array("id" => $child->getId(), "text" => $child->getKey(), "type" => $child->getType(), "path" => $child->getFullPath(), "basePath" => $child->getPath(), "elementType" => "object", "locked" => $child->isLocked(), "lockOwner" => $child->getLocked() ? true : false);
     $tmpObject["isTarget"] = false;
     $tmpObject["allowDrop"] = false;
     $tmpObject["allowChildren"] = false;
     $tmpObject["leaf"] = $child->hasNoChilds();
     //        $tmpObject["iconCls"] = "pimcore_icon_object";
     $tmpObject["isTarget"] = true;
     $tmpObject["allowDrop"] = true;
     $tmpObject["allowChildren"] = true;
     $tmpObject["leaf"] = false;
     $tmpObject["cls"] = "";
     if ($child->getType() == "folder") {
         //            $tmpObject["iconCls"] = "pimcore_icon_folder";
         $tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId());
     } else {
         $tmpObject["published"] = $child->isPublished();
         $tmpObject["className"] = $child->getClass()->getName();
         $tmpObject["qtipCfg"] = array("title" => "ID: " . $child->getId(), "text" => 'Type: ' . $child->getClass()->getName());
         if (!$child->isPublished()) {
             $tmpObject["cls"] .= "pimcore_unpublished ";
         }
         //            if ($child->getClass()->getIcon()) {
         //                unset($tmpObject["iconCls"]);
         //                $tmpObject["icon"] = $child->getClass()->getIcon();
         //            }
     }
     if ($child->getElementAdminStyle()->getElementIcon()) {
         $tmpObject["icon"] = $child->getO_elementAdminStyle()->getElementIcon();
     }
     if ($child->getElementAdminStyle()->getElementIconClass()) {
         $tmpObject["iconCls"] = $child->getO_elementAdminStyle()->getElementIconClass();
     }
     if ($child->getElementAdminStyle()->getElementCssClass()) {
         $tmpObject["cls"] .= $child->getO_elementAdminStyle()->getElementCssClass() . " ";
     }
     $tmpObject["expanded"] = $child->hasNoChilds();
     $tmpObject["permissions"] = $child->getUserPermissions($this->getUser());
     if ($child->isLocked()) {
         $tmpObject["cls"] .= "pimcore_treenode_locked ";
     }
     if ($child->getLocked()) {
         $tmpObject["cls"] .= "pimcore_treenode_lockOwner ";
     }
     return $tmpObject;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:51,代码来源:ObjectController.php

示例3: getDataFromEditmode

 /**
  * @see Object_Class_Data::getDataFromEditmode
  * @param string $data
  * @param null|Object_Abstract $object
  * @return string
  */
 public function getDataFromEditmode($data, $object = null)
 {
     $getter = "get" . ucfirst($this->getName());
     $container = $object->{$getter}();
     //$this->getObject()->$getter();
     if (empty($container)) {
         $className = $object->getClass()->getName();
         //$this->getObject()->getClass()->getName();
         $containerClass = "Object_" . ucfirst($className) . "_" . ucfirst($this->getName());
         $container = new $containerClass($object, $this->getName());
         //$this->getObject(), $this->getName());
     }
     if (is_array($data)) {
         foreach ($data as $collectionRaw) {
             $collectionData = array();
             $collectionDef = Object_Objectbrick_Definition::getByKey($collectionRaw["type"]);
             $getter = "get" . ucfirst($collectionRaw["type"]);
             $brick = $container->{$getter}();
             if (empty($brick)) {
                 $brickClass = "Object_Objectbrick_Data_" . ucfirst($collectionRaw["type"]);
                 $brick = new $brickClass($object);
                 //$this->getObject());
             }
             if ($collectionRaw["data"] == "deleted") {
                 $brick->setDoDelete(true);
             } else {
                 foreach ($collectionDef->getFieldDefinitions() as $fd) {
                     if (array_key_exists($fd->getName(), $collectionRaw["data"])) {
                         $collectionData[$fd->getName()] = $fd->getDataFromEditmode($collectionRaw["data"][$fd->getName()], $object);
                     }
                 }
                 $brick->setValues($collectionData);
                 $brick->setFieldname($this->getName());
             }
             $setter = "set" . ucfirst($collectionRaw["type"]);
             $container->{$setter}($brick);
         }
     }
     return $container;
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:46,代码来源:Objectbricks.php

示例4: createObjectComparisonString

 /**
  * @param  Object_Abstract $object
  * @return string
  */
 protected static function createObjectComparisonString($object, $ignoreCopyDifferences)
 {
     if ($object instanceof Object_Abstract) {
         $o = array();
         if ($object instanceof Object_Concrete) {
             foreach ($object->getClass()->getFieldDefinitions() as $key => $value) {
                 $o[$key] = self::getComparisonDataForField($key, $value, $object);
             }
             $o["published"] = $object->isPublished();
         }
         if (!$ignoreCopyDifferences) {
             $o["id"] = $object->getId();
             $o["key"] = $object->getKey();
             $o["modification"] = $object->getModificationDate();
             $o["creation"] = $object->getCreationDate();
             $o["userModified"] = $object->getUserModification();
             $o["parentId"] = $object->getParentId();
             $o["path"] = $object->getPath;
         }
         $o["userOwner"] = $object->getUserOwner();
         $properties = $object->getProperties();
         $o = array_merge($o, self::createPropertiesComparisonString($properties));
         return implode(",", $o);
     } else {
         return null;
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:31,代码来源:Tool.php

示例5: csvObjectData

 /**
  * Flattens object data to an array with key=>value where
  * value is simply a string representation of the value (for objects, hrefs and assets the full path is used)
  *
  * @param Object_Abstract $object
  * @return array
  */
 protected function csvObjectData($object)
 {
     $o = array();
     foreach ($object->getClass()->getFieldDefinitions() as $key => $value) {
         //exclude remote owner fields
         if (!($value instanceof Object_Class_Data_Relations_Abstract and $value->isRemoteOwner())) {
             $o[$key] = $value->getForCsvExport($object);
         }
     }
     $o["id (system)"] = $object->getId();
     $o["key (system)"] = $object->getKey();
     $o["fullpath (system)"] = $object->getFullPath();
     $o["published (system)"] = $object->isPublished();
     return $o;
 }
开发者ID:nblackman,项目名称:pimcore,代码行数:22,代码来源:ObjectHelperController.php


注:本文中的Object_Abstract::getClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。