本文整理匯總了PHP中eZContentObject::mainNodeID方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObject::mainNodeID方法的具體用法?PHP eZContentObject::mainNodeID怎麽用?PHP eZContentObject::mainNodeID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::mainNodeID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __get
/**
* Getter
* Returns given attribute for current content object if it exists (ie. main_node_id).
* Will throw an exception otherwise.
* All "classic" attributes can be used (See {@link eZContentObject::definition()}).
* @param $name
* @throws ezcBasePropertyNotFoundException
*/
public function __get($name)
{
$ret = null;
switch ($name) {
case 'locations':
if (!$this->currentLocations instanceof SQLILocationSet) {
$this->refreshLocations();
}
$ret = $this->currentLocations;
break;
case 'defaultLocation':
if (!$this->currentLocations instanceof SQLILocationSet) {
$this->refreshLocations();
}
$ret = $this->currentLocations[$this->contentObject->mainNodeID()];
break;
default:
if ($this->contentObject->hasAttribute($name)) {
$ret = $this->contentObject->attribute($name);
} else {
throw new ezcBasePropertyNotFoundException($name);
}
}
return $ret;
}
示例2: updateContentObject
private function updateContentObject(eZContentObject $eZContentObject)
{
$mainNodeID = $eZContentObject->mainNodeID();
$parentNodeID = eZContentObjectTreeNode::getParentNodeId($mainNodeID);
$classIdentifier = $eZContentObject->ClassIdentifier;
$remoteID = $eZContentObject->RemoteID;
if (!eZContentClass::fetchByIdentifier($classIdentifier)) {
throw new Exception("La classe" . $classIdentifier . "non esiste in questa installazione");
}
$params = array();
$params['class_identifier'] = $classIdentifier;
$params['remote_id'] = $remoteID;
$params['parent_node_id'] = $parentNodeID;
$params['attributes'] = $this->getAttributesStringArray($eZContentObject);
$result = eZContentFunctions::updateAndPublishObject($eZContentObject, $params);
return $result;
}