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


PHP Concrete::getClassId方法代码示例

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


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

示例1: delete

 /**
  * @param Object\Concrete $object
  * @return void
  */
 public function delete(Object\Concrete $object)
 {
     // update data for store table
     $storeTable = $this->model->getDefinition()->getTableName($object->getClass(), false);
     $this->db->delete($storeTable, $this->db->quoteInto("o_id = ?", $object->getId()));
     // update data for query table
     $queryTable = $this->model->getDefinition()->getTableName($object->getClass(), true);
     $oldData = $this->db->fetchRow("SELECT * FROM " . $queryTable . " WHERE o_id = ?", $object->getId());
     $this->db->delete($queryTable, $this->db->quoteInto("o_id = ?", $object->getId()));
     //update data for relations table
     $this->db->delete("object_relations_" . $object->getClassId(), "src_id = " . $object->getId() . " AND ownertype = 'objectbrick' AND ownername = '" . $this->model->getFieldname() . "' AND position = '" . $this->model->getType() . "'");
     $this->inheritanceHelper = new Object\Concrete\Dao\InheritanceHelper($object->getClassId(), "o_id", $storeTable, $queryTable);
     $this->inheritanceHelper->resetFieldsToCheck();
     $objectVars = get_object_vars($this->model);
     foreach ($objectVars as $key => $value) {
         $fd = $this->model->getDefinition()->getFieldDefinition($key);
         if ($fd) {
             if ($fd->getQueryColumnType()) {
                 //exclude untouchables if value is not an array - this means data has not been loaded
                 //get changed fields for inheritance
                 if ($fd instanceof Object\ClassDefinition\Data\CalculatedValue) {
                     continue;
                 }
                 if ($fd->isRelationType()) {
                     if ($oldData[$key] != null) {
                         $this->inheritanceHelper->addRelationToCheck($key, $fd);
                     }
                 } else {
                     if ($oldData[$key] != null) {
                         $this->inheritanceHelper->addFieldToCheck($key, $fd);
                     }
                 }
                 if (method_exists($fd, "delete")) {
                     $fd->delete($object);
                 }
             }
         }
     }
     $this->inheritanceHelper->doDelete($object->getId());
     $this->inheritanceHelper->resetFieldsToCheck();
 }
开发者ID:pimcore,项目名称:pimcore,代码行数:45,代码来源:Dao.php

示例2: delete

 /**
  * @param Object\Concrete $object
  * @return void
  */
 public function delete($object)
 {
     $db = Resource::get();
     $db->delete("object_metadata_" . $object->getClassId(), $db->quoteInto("o_id = ?", $object->getId()) . " AND " . $db->quoteInto("fieldname = ?", $this->getName()));
 }
开发者ID:yonetici,项目名称:pimcore-coreshop-demo,代码行数:9,代码来源:ObjectsMetadata.php

示例3: delete

 /**
  * @param Object\Concrete $object
  */
 public function delete(Object\Concrete $object)
 {
     // empty or create all relevant tables
     $fieldDef = $object->getClass()->getFieldDefinition($this->model->getFieldname());
     foreach ($fieldDef->getAllowedTypes() as $type) {
         try {
             $definition = Object\Fieldcollection\Definition::getByKey($type);
         } catch (\Exception $e) {
             continue;
         }
         $tableName = $definition->getTableName($object->getClass());
         try {
             $this->db->delete($tableName, $this->db->quoteInto("o_id = ?", $object->getId()) . " AND " . $this->db->quoteInto("fieldname = ?", $this->model->getFieldname()));
         } catch (\Exception $e) {
             // create definition if it does not exist
             $definition->createUpdateTable($object->getClass());
         }
     }
     // empty relation table
     $this->db->delete("object_relations_" . $object->getClassId(), "ownertype = 'fieldcollection' AND " . $this->db->quoteInto("ownername = ?", $this->model->getFieldname()) . " AND " . $this->db->quoteInto("src_id = ?", $object->getId()));
 }
开发者ID:yonetici,项目名称:pimcore-coreshop-demo,代码行数:24,代码来源:Resource.php

示例4: getValidLayouts

 /**
  * @param Concrete $object
  * @return array
  */
 public static function getValidLayouts(Concrete $object)
 {
     $user = AdminTool::getCurrentUser();
     $resultList = array();
     $isMasterAllowed = $user->getAdmin();
     $permissionSet = $object->getPermissions("layouts", $user);
     $layoutPermissions = self::getLayoutPermissions($object->getClassId(), $permissionSet);
     if (!$layoutPermissions || isset($layoutPermissions[0])) {
         $isMasterAllowed = true;
     }
     if ($user->getAdmin()) {
         $superLayout = new ClassDefinition\CustomLayout();
         $superLayout->setId(-1);
         $superLayout->setName("Master (Admin Mode)");
         $resultList[-1] = $superLayout;
     }
     if ($isMasterAllowed) {
         $master = new ClassDefinition\CustomLayout();
         $master->setId(0);
         $master->setName("Master");
         $resultList[0] = $master;
     }
     $classId = $object->getClassId();
     $list = new ClassDefinition\CustomLayout\Listing();
     $list->setOrderKey("name");
     $condition = "classId = " . $list->quote($classId);
     if (count($layoutPermissions) && !$isMasterAllowed) {
         $layoutIds = array_values($layoutPermissions);
         $condition .= " AND id IN (" . implode(",", $layoutIds) . ")";
     }
     $list->setCondition($condition);
     $list = $list->load();
     if (!count($resultList) && !count($list) || count($resultList) == 1 && !count($list)) {
         return array();
     }
     foreach ($list as $customLayout) {
         $resultList[$customLayout->getId()] = $customLayout;
     }
     return $resultList;
 }
开发者ID:elavarasann,项目名称:pimcore,代码行数:44,代码来源:Service.php

示例5: delete

 /**
  * @param Object\Concrete $object
  * @return void
  */
 public function delete($object, $params = [])
 {
     $db = Db::get();
     if ($params && $params["context"] && $params["context"]["containerType"] == "fieldcollection" && $params["context"]["subContainerType"] == "localizedfield") {
         $context = $params["context"];
         $index = $context["index"];
         $containerName = $context["fieldname"];
         $db->delete("object_metadata_" . $object->getClassId(), $db->quoteInto("o_id = ?", $object->getId()) . " AND ownertype = 'localizedfield' AND " . $db->quoteInto("ownername LIKE ?", "/fieldcollection~" . $containerName . "/" . $index . "/%") . " AND " . $db->quoteInto("fieldname = ?", $this->getName()));
     } else {
         $db->delete("object_metadata_" . $object->getClassId(), $db->quoteInto("o_id = ?", $object->getId()) . " AND " . $db->quoteInto("fieldname = ?", $this->getName()));
     }
 }
开发者ID:pimcore,项目名称:pimcore,代码行数:16,代码来源:MultihrefMetadata.php


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