本文整理汇总了PHP中eZContentClass::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentClass::exists方法的具体用法?PHP eZContentClass::exists怎么用?PHP eZContentClass::exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentClass
的用法示例。
在下文中一共展示了eZContentClass::exists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchObjectAttributeHTTPInput
/**
* Fetches the HTTP POST input and stores it in the data instance
*
* @param eZHTTPTool $http
* @param string $base
* @param eZContentObjectAttribute $contentObjectAttribute
*
* @return bool
*/
function fetchObjectAttributeHTTPInput($http, $base, $contentObjectAttribute)
{
$classList = $http->postVariable($base . self::CLASS_LIST_VARIABLE . $contentObjectAttribute->attribute("id"), array());
$classList = !is_array($classList) ? array() : $classList;
$validClassIdentifiers = array();
foreach ($classList as $classIdentifier) {
if (eZContentClass::exists($classIdentifier, eZContentClass::VERSION_STATUS_DEFINED, false, true)) {
$validClassIdentifiers[] = $classIdentifier;
}
}
if (!empty($validClassIdentifiers)) {
$contentObjectAttribute->setAttribute(self::CLASS_LIST_FIELD, implode(",", $validClassIdentifiers));
} else {
$contentObjectAttribute->setAttribute(self::CLASS_LIST_FIELD, "");
}
return true;
}
示例2: handleParameters
function handleParameters($packageType, $package, $cli, $type, $arguments)
{
$classList = false;
foreach ($arguments as $argument) {
if ($argument[0] == '-') {
if (strlen($argument) > 1 and $argument[1] == '-') {
} else {
}
} else {
if ($classList === false) {
$classList = array();
$classArray = explode(',', $argument);
$error = false;
foreach ($classArray as $classID) {
if (in_array($classID, $classList)) {
$cli->notice("Content class {$classID} already in list");
continue;
}
if (is_numeric($classID)) {
if (!eZContentClass::exists($classID, 0, false, false)) {
$cli->error("Content class with ID {$classID} does not exist");
$error = true;
} else {
unset($class);
$class = eZContentClass::fetch($classID);
$classList[] = array('id' => $classID, 'identifier' => $class->attribute('identifier'), 'value' => $classID);
}
} else {
$realClassID = eZContentClass::exists($classID, 0, false, true);
if (!$realClassID) {
$cli->error("Content class with identifier {$classID} does not exist");
$error = true;
} else {
unset($class);
$class = eZContentClass::fetch($realClassID);
$classList[] = array('id' => $realClassID, 'identifier' => $class->attribute('identifier'), 'value' => $classID);
}
}
}
if ($error) {
return false;
}
}
}
}
if ($classList === false) {
$cli->error("No class ids chosen");
return false;
}
return array('class-list' => $classList);
}