本文整理汇总了PHP中eZContentObjectTreeNode::setAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectTreeNode::setAttribute方法的具体用法?PHP eZContentObjectTreeNode::setAttribute怎么用?PHP eZContentObjectTreeNode::setAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObjectTreeNode
的用法示例。
在下文中一共展示了eZContentObjectTreeNode::setAttribute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
/**
* Setter
* Sets value to an attribute for the content node.
* All "classic" attributes can be used (See {@link eZContentObjectTreeNode::definition()}).
* If attribute doesn't exist, will throw an exception
* @param $name Attribute name
* @param $value Attribute value
* @throws ezcBasePropertyNotFoundException
* @return void
*/
public function __set($name, $value)
{
$this->getNode();
if (!$this->node->hasAttribute($name)) {
throw new ezcBasePropertyNotFoundException($name);
}
$this->node->setAttribute($name, $value);
}
示例2: setAttribute
function setAttribute($attr, $value)
{
switch ($attr) {
case 'language_code':
$this->CurrentLanguage = $value;
break;
default:
if (in_array($attr, $this->LocalAttributeNameList)) {
$this->LocalAttributeValueList[$attr] = $value;
} else {
eZContentObjectTreeNode::setAttribute($attr, $value);
}
}
}
示例3: eZContentObjectTreeNode
$pathString = '';
$pathIdentificationString = '';
$requestedURIString = '';
$depth = 2;
if (isset($parentNodeObject) && is_object($parentNodeObject)) {
$pathString = $parentNodeObject->attribute('path_string') . $virtualNodeID . '/';
$pathIdentificationString = $parentNodeObject->attribute('path_identification_string');
//TODO add current node ident string.
$depth = $parentNodeObject->attribute('depth') + 1;
$requestedURIString = $parentNodeObject->attribute('url_alias');
}
if (isset($node) && is_object($node)) {
$requestedURIString = $node->attribute('url_alias');
}
$node = new eZContentObjectTreeNode();
$node->setAttribute('contentobject_version', $EditVersion);
$node->setAttribute('path_identification_string', $pathIdentificationString);
$node->setAttribute('contentobject_id', $ObjectID);
$node->setAttribute('parent_node_id', $parentNodeID);
$node->setAttribute('main_node_id', $virtualNodeID);
$node->setAttribute('path_string', $pathString);
$node->setAttribute('depth', $depth);
$node->setAttribute('node_id', $virtualNodeID);
$node->setAttribute('sort_field', $class->attribute('sort_field'));
$node->setAttribute('sort_order', $class->attribute('sort_order'));
$node->setAttribute('remote_id', eZRemoteIdUtility::generate('node'));
$node->setName($objectName);
$node->setContentObject($contentObject);
if ($Params['SiteAccess']) {
$siteAccess = htmlspecialchars($Params['SiteAccess']);
} else {
示例4: customObjectAttributeHTTPAction
function customObjectAttributeHTTPAction($http, $action, $contentObjectAttribute, $parameters)
{
switch ($action) {
case "send_preview":
$module = $parameters['module'];
var_dump($module->obj);
//viewData() );
var_dump($obj);
/*
$classAttribute = $contentObjectAttribute->contentClassAttribute();
var_dump($http);
var_dump($action);
var_dump($contentObjectAttribute);
var_dump
//$classAttribute = $contentObjectAttribute->contentClassAttribute();
//$module = $classAttribute->currentModule();
$module = $parameters['module'];
//var_dump($module);
//var_dump($parameters);
$ObjectVersion = 26;
$ObjectID = 99;
$contentObject = ezContentObjectVersion::fetchVersion( $ObjectVersion ,$ObjectID);
$tpl =& templateInit();
$tpl->setVariable('object', $contentObject);
//$tpl->setVariable('newsletter', $newsletter);
$tpl->fetch( 'design:eznewsletter/newsletter_preview.tpl' );
*/
/*
$cacheFileArray = array( 'cache_dir' => false, 'cache_path' => false );
$NodeID = 101;
//$Module = $Params['Module'];
$tpl = templateInit();
$LanguageCode = $Params['Language'];
$ViewMode = "full";
$Offset = $Params['Offset'];
//$ini = eZINI::instance();
$Year = $Params['Year'];
$Month = $Params['Month'];
$Day = $Params['Day'];
$viewParameters = array( 'offset' => $Offset,
'year' => $Year,
'month' => $Month,
'day' => $Day,
'namefilter' => false );
$viewParameters = array_merge( $viewParameters, $UserParameters );
$collectionAttributes = false;
if ( isset( $Params['CollectionAttributes'] ) )
$collectionAttributes = $Params['CollectionAttributes'];
$validation = array( 'processed' => false, 'attributes' => array() );
if ( isset( $Params['AttributeValidation'] ) )
$validation = $Params['AttributeValidation'];
$localVars = array( "cacheFileArray", "NodeID", "Module", "tpl",
"LanguageCode", "ViewMode", "Offset", "ini",
"cacheFileArray", "viewParameters", "collectionAttributes",
"validation" );
$args = compact( $localVars );
// the false parameter will disable generation of the 'binarydata' entry
$data = eZNodeviewfunctions::contentViewGenerate( false, $args );
*/
$tpl = templateInit();
$EditVersion = 26;
$pathIdentificationString = "";
$ObjectID = 99;
$parentNodeID = 2;
$virtualNodeID = null;
$pathString = "";
$depth = 2;
$objectName = "OMG";
$node = new eZContentObjectTreeNode();
$node->setAttribute('contentobject_version', $EditVersion);
$node->setAttribute('path_identification_string', $pathIdentificationString);
$node->setAttribute('contentobject_id', $ObjectID);
$node->setAttribute('parent_node_id', $parentNodeID);
$node->setAttribute('main_node_id', $virtualNodeID);
$node->setAttribute('path_string', $pathString);
$node->setAttribute('depth', $depth);
$node->setAttribute('node_id', $virtualNodeID);
//$node->setAttribute( 'sort_field', $class->attribute( 'sort_field' ) );
//$node->setAttribute( 'sort_order', $class->attribute( 'sort_order' ) );
$node->setName($objectName);
$node->setContentObject($contentObject);
$contentObject = null;
$LanguageCode = null;
$viewParameters = array();
$contentObject = eZContentObject::fetch($ObjectID);
$Result = eZNodeviewfunctions::generateNodeViewData($tpl, $node, $contentObject, $LanguageCode, 'full', 0);
var_dump($Result);
//var_dump( $module->run("versionview") );
$contentObjectAttribute->setValidationError(ezi18n('kernel/classes/datatypes', 'The email address is not valid.'));
//.........这里部分代码省略.........
示例5: eZContentObjectTreeNode
$pathString = '';
$pathIdentificationString = '';
$requestedURIString = '';
$depth = 2;
if (isset($parentNodeObject) && is_object($parentNodeObject)) {
$pathString = $parentNodeObject->attribute('path_string') . $virtualNodeID . '/';
$pathIdentificationString = $parentNodeObject->attribute('path_identification_string');
//TODO add current node ident string.
$depth = $parentNodeObject->attribute('depth') + 1;
$requestedURIString = $parentNodeObject->attribute('url_alias');
}
if (isset($node) && is_object($node)) {
$requestedURIString = $node->attribute('url_alias');
}
$node = new eZContentObjectTreeNode();
$node->setAttribute('contentobject_version', $EditVersion);
$node->setAttribute('path_identification_string', $pathIdentificationString);
$node->setAttribute('contentobject_id', $ObjectID);
$node->setAttribute('parent_node_id', $parentNodeID);
$node->setAttribute('main_node_id', $virtualNodeID);
$node->setAttribute('path_string', $pathString);
$node->setAttribute('depth', $depth);
$node->setAttribute('node_id', $virtualNodeID);
$node->setAttribute('sort_field', $class->attribute('sort_field'));
$node->setAttribute('sort_order', $class->attribute('sort_order'));
$node->setAttribute('remote_id', md5((string) mt_rand() . (string) time()));
$node->setName($objectName);
$node->setContentObject($contentObject);
if ($Params['SiteAccess']) {
$siteAccess = $Params['SiteAccess'];
} else {