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


PHP Object_Abstract::getType方法代码示例

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


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

示例1: getDependencyForFrontend

 /**
  * @param Document|Asset|Object_Abstract $element
  * @return array
  */
 public static function getDependencyForFrontend($element)
 {
     if ($element instanceof Document) {
         return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "document", "subtype" => $element->getType());
     } else {
         if ($element instanceof Asset) {
             return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "asset", "subtype" => $element->getType());
         } else {
             if ($element instanceof Object_Abstract) {
                 return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "object", "subtype" => $element->geto_Type());
             }
         }
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:18,代码来源:Service.php

示例2: getDataForEditmode

 /**
  * @see Object_Class_Data::getDataForEditmode
  * @param Asset|Document|Object_Abstract $data
  * @param null|Object_Abstract $object
  * @return array
  */
 public function getDataForEditmode($data, $object = null)
 {
     if ($data) {
         $r = array("id" => $data->getId(), "path" => $data->getFullPath());
         if ($data instanceof Document) {
             $r["subtype"] = $data->getType();
             $r["type"] = "document";
         } else {
             if ($data instanceof Asset) {
                 $r["subtype"] = $data->getType();
                 $r["type"] = "asset";
             } else {
                 if ($data instanceof Object_Abstract) {
                     $r["subtype"] = $data->getO_Type();
                     $r["type"] = "object";
                 }
             }
         }
         return $r;
     }
     return;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:28,代码来源:Href.php

示例3: 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

示例4: 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


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