本文整理汇总了PHP中eZWorkflowProcess::attribute方法的典型用法代码示例。如果您正苦于以下问题:PHP eZWorkflowProcess::attribute方法的具体用法?PHP eZWorkflowProcess::attribute怎么用?PHP eZWorkflowProcess::attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZWorkflowProcess
的用法示例。
在下文中一共展示了eZWorkflowProcess::attribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @param eZWorkflowProcess $process
* @param eZWorkflowEvent $event
* @return int
*/
function execute( $process, $event )
{
$parameters = $process->attribute( 'parameter_list' );
$deleteNodeIds = isset($parameters['node_id_list']) ? $parameters['node_id_list'] : array();
$removeLocationNodeIds = array();
if(isset($parameters['node_list']))
{
foreach($parameters['node_list'] as $node)
{
$removeLocationNodeIds[] = $node->attribute('node_id');
}
}
$nodeIds = array_merge($deleteNodeIds, $removeLocationNodeIds);
/* @type $selections MMSelections[] */
$selections = MMSelections::fetchObjectList(
MMSelections::definition(),
null,
array( 'node_id' => array( array( $nodeIds ) ) )
);
foreach( $selections as $selection )
{
$selection->remove();
}
return self::STATUS_ACCEPTED;
}
示例2: execute
/**
* @param eZWorkflowProcess $process
* @param eZWorkflowEvent $event
* @return int
*/
function execute( $process, $event )
{
// Get some information about the object being passed
$parameters = $process->attribute( 'parameter_list' );
$object = eZContentObject::fetch( $parameters['object_id'] );
if($object->ClassIdentifier != 'article')
return self::STATUS_ACCEPTED;
/* @type $dataMap eZContentObjectAttribute[] */
$dataMap = $object->dataMap();
if(isset($dataMap['source']))
{
$sourceString = MMNewsSource::getSourceString($object);
if($sourceString)
{
$dataMap['source']->setAttribute('data_text', $sourceString);
$dataMap['source']->store();
}
eZContentCacheManager::clearContentCache($object->attribute('id'));
}
return self::STATUS_ACCEPTED;
}