本文整理汇总了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();
}
示例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()));
}
示例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()));
}
示例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;
}
示例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()));
}
}