本文整理匯總了PHP中eZContentClassAttribute::definition方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentClassAttribute::definition方法的具體用法?PHP eZContentClassAttribute::definition怎麽用?PHP eZContentClassAttribute::definition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentClassAttribute
的用法示例。
在下文中一共展示了eZContentClassAttribute::definition方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: removeAttributes
function removeAttributes($removeAttributes = false, $version = false)
{
if (is_array($removeAttributes)) {
$db = eZDB::instance();
$db->begin();
foreach ($removeAttributes as $attribute) {
$attribute->removeThis();
}
$db->commit();
} else {
$contentClassID = $this->ID;
if ($version === false) {
$version = $this->Version;
}
$classAttributes = $this->fetchAttributes();
$db = eZDB::instance();
$db->begin();
foreach ($classAttributes as $classAttribute) {
$dataType = $classAttribute->dataType();
$dataType->deleteStoredClassAttribute($classAttribute, $version);
}
eZPersistentObject::removeObject(eZContentClassAttribute::definition(), array('contentclass_id' => $contentClassID, 'version' => $version));
$db->commit();
}
}
示例2: move
function move( $down, $params = null )
{
if ( is_array( $params ) )
{
$pos = $params['placement'];
$cid = $params['contentclass_id'];
$version = $params['version'];
}
else
{
$pos = $this->Position;
$cid = $this->ContentClassID;
$version = $this->Version;
}
eZPersistentObject::reorderObject( eZContentClassAttribute::definition(),
array( 'placement' => $pos ),
array( 'contentclass_id' => $cid,
'version' => $version ),
$down );
}
示例3: getSubTreeLimitationsCount
/**
* Returns count of eZContentClassAttribute objects (represented as subtree limitation count)
*
* @return integer
*/
function getSubTreeLimitationsCount()
{
if ($this->attribute('main_tag_id') == 0) {
return eZPersistentObject::count(eZContentClassAttribute::definition(), array('data_type_string' => 'eztags', eZTagsType::SUBTREE_LIMIT_FIELD => $this->attribute('id'), 'version' => eZContentClass::VERSION_STATUS_DEFINED));
} else {
return 0;
}
}
示例4: foreach
$attribute->setAttribute('category', $categoryArray[$attributeID]);
}
}
}
}
// Fixup input
if ($requireFixup) {
foreach ($attributes as $attribute) {
$dataType = $attribute->dataType();
$status = $dataType->fixupClassAttributeHTTPInput($http, 'ContentClass', $attribute);
}
}
$cur_datatype = 'ezstring';
// Apply HTTP POST variables
if ($contentClassHasInput) {
eZHTTPPersistence::fetch('ContentAttribute', eZContentClassAttribute::definition(), $attributes, $http, true, 'id');
if ($http->hasPostVariable('ContentAttribute_name')) {
$attributeNames = $http->postVariable('ContentAttribute_name');
foreach ($attributes as $attribute) {
$key = $attribute->attribute('id');
if (isset($attributeNames[$key])) {
$attribute->setName($attributeNames[$key], $EditLanguage);
}
}
}
if ($http->hasPostVariable('ContentAttribute_description')) {
$attributeNames = $http->postVariable('ContentAttribute_description');
foreach ($attributes as $attribute) {
$key = $attribute->attribute('id');
if (isset($attributeNames[$key])) {
$attribute->setDescription($attributeNames[$key], $EditLanguage);
示例5: removeAttributes
function removeAttributes($removeAttributes = false, $version = false)
{
if (is_array($removeAttributes)) {
$db = eZDB::instance();
$db->begin();
foreach ($removeAttributes as $attribute) {
$attribute->removeThis();
}
$db->commit();
} else {
$contentClassID = $this->ID;
if ($version === false) {
$version = $this->Version;
}
$classAttributes = $this->fetchAttributes();
$db = eZDB::instance();
$db->begin();
foreach ($classAttributes as $classAttribute) {
$dataType = $classAttribute->dataType();
if ($dataType === null) {
eZDebug::writeError("Skipping removal of class attribute for non-existent datatype " . $classAttribute->DataTypeString, __METHOD__);
continue;
}
$dataType->deleteStoredClassAttribute($classAttribute, $version);
}
eZPersistentObject::removeObject(eZContentClassAttribute::definition(), array('contentclass_id' => $contentClassID, 'version' => $version));
$db->commit();
}
}