本文整理汇总了PHP中eZContentObjectAttribute::store方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectAttribute::store方法的具体用法?PHP eZContentObjectAttribute::store怎么用?PHP eZContentObjectAttribute::store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObjectAttribute
的用法示例。
在下文中一共展示了eZContentObjectAttribute::store方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$classIdentifier = "ezimagetype_test_class";
$this->imageClass = new ezpClass("eZImageType test class", $classIdentifier, "eZImageType test class");
$this->imageClass->add("Image", "image", "ezimage");
$this->imageClass->store();
$this->imageObject = new ezpObject($classIdentifier, 2);
$this->imageObject->name = __METHOD__;
$dataMap = $this->imageObject->object->dataMap();
$this->fileAttribute = $dataMap["image"];
$dataType = new eZImageType();
$dataType->fromString($this->fileAttribute, self::IMAGE_FILE_PATH);
$this->fileAttribute->store();
$this->imageObject->publish();
$this->imageObject->refresh();
}
示例2: initializeObjectAttribute
/**
* Initializes the object attribute with some data.
*
* @param eZContentObjectAttribute $objectAttribute
* @param int $currentVersion
* @param eZContentObjectAttribute $originalContentObjectAttribute
*/
public function initializeObjectAttribute($objectAttribute, $currentVersion, $originalContentObjectAttribute)
{
if ($currentVersion != false) {
$content = $originalContentObjectAttribute->content();
$objectAttribute->setContent($content);
$objectAttribute->store();
}
}
示例3: initializeObjectAttribute
/**
* Init attribute ( also handles version to version copy, and attribute to attribute copy )
*
* @param eZContentObjectAttribute $contentObjectAttribute
* @param int|null $currentVersion
* @param eZContentObjectAttribute $originalContentObjectAttribute
*/
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
{
if ( $currentVersion == false )
{
$contentObjectAttribute->setAttribute( 'data_int', 0 );
}
else if ( $contentObjectAttribute->attribute( 'id' ) != 0 )
{
if ( $originalContentObjectAttribute->attribute( 'data_int' ) != 0 )
{
$gmapObject = $originalContentObjectAttribute->attribute( 'content' );
$gmapObject->setAttribute( 'contentobject_attribute_id', $contentObjectAttribute->attribute( 'id' ) );//in case of copy
$gmapObject->setAttribute( 'contentobject_version', $contentObjectAttribute->attribute( 'version' ) );
$contentObjectAttribute->setContent( $gmapObject );
$contentObjectAttribute->store();
}
}
}
示例4: onPublish
//.........这里部分代码省略.........
if ($zone->toBeRemoved()) {
foreach ($zone->attribute('blocks') as $index => $block) {
$block->setAttribute('action', 'remove');
}
}
foreach ($zone->attribute('blocks') as $block) {
$blockID = $block->attribute('id');
$blockType = $block->attribute('type');
$escapedBlockType = $db->escapeString($blockType);
$action = $block->attribute('action');
$fetchParams = $block->attribute('fetch_params');
$zoneID = $block->attribute('zone_id');
$blockName = $block->attribute('name');
$escapedBlockName = $db->escapeString($blockName);
switch ($action) {
case 'remove':
$db->query("UPDATE ezm_block SET is_removed='1' WHERE id='" . $blockID . "'");
break;
case 'add':
$blockCount = $db->arrayQuery("SELECT COUNT( id ) as count FROM ezm_block WHERE id='" . $blockID . "'");
if ($blockCount[0]['count'] == 0) {
$rotationType = 0;
$rotationInterval = 0;
$overflowID = null;
if ($block->hasAttribute('rotation')) {
$rotation = $block->attribute('rotation');
$rotationType = $rotation['type'];
$rotationInterval = $rotation['interval'];
}
if ($block->hasAttribute('overflow_id')) {
$overflowID = $block->attribute('overflow_id');
}
$db->query("INSERT INTO ezm_block ( id, zone_id, name, node_id, overflow_id, block_type, fetch_params, rotation_type, rotation_interval )\n VALUES ( '" . $blockID . "',\n '" . $zoneID . "',\n '" . $escapedBlockName . "',\n '" . $nodeID . "',\n '" . $overflowID . "',\n '" . $escapedBlockType . "',\n '" . $fetchParams . "',\n '" . $rotationType . "',\n '" . $rotationInterval . "' )");
}
break;
default:
$rotationType = 0;
$rotationInterval = 0;
$overflowID = null;
if ($block->hasAttribute('rotation')) {
$rotation = $block->attribute('rotation');
$rotationType = $rotation['type'];
$rotationInterval = $rotation['interval'];
}
if ($block->hasAttribute('overflow_id')) {
$overflowID = $block->attribute('overflow_id');
}
$db->query("UPDATE ezm_block SET name='" . $escapedBlockName . "',\n overflow_id='" . $overflowID . "',\n fetch_params='" . $fetchParams . "',\n rotation_type='" . $rotationType . "',\n rotation_interval='" . $rotationInterval . "'\n WHERE id='" . $blockID . "'");
break;
}
if ($block->getItemCount() != 0) {
foreach ($block->attribute('items') as $item) {
$action = $item->attribute('action');
switch ($action) {
case 'remove':
$db->query("DELETE FROM ezm_pool\n WHERE object_id='" . $item->attribute('object_id') . "'\n AND block_id='" . $blockID . "'");
break;
case 'add':
$itemCount = $db->arrayQuery("SELECT COUNT( * ) as count FROM ezm_pool\n WHERE block_id='" . $blockID . "'\n AND object_id='" . $item->attribute('object_id') . "'");
if ($itemCount[0]['count'] == 0) {
$db->query("INSERT INTO ezm_pool ( block_id, object_id, node_id, priority, ts_publication )\n VALUES ( '" . $blockID . "',\n '" . $item->attribute('object_id') . "',\n '" . $item->attribute('node_id') . "',\n '" . $item->attribute('priority') . "',\n '" . $item->attribute('ts_publication') . "' )");
}
break;
case 'modify':
if ($item->hasAttribute('ts_publication')) {
$db->query("UPDATE ezm_pool SET ts_publication='" . $item->attribute('ts_publication') . "'\n WHERE object_id='" . $item->attribute('object_id') . "'\n AND block_id='" . $blockID . "'");
}
if ($item->hasAttribute('priority')) {
$db->query("UPDATE ezm_pool SET priority='" . $item->attribute('priority') . "'\n WHERE object_id='" . $item->attribute('object_id') . "'\n AND block_id='" . $blockID . "'");
}
//if there is ts_hidden and ts_visible, update the two fields. This is the case when add items from history
if ($item->hasAttribute('ts_hidden') && $item->hasAttribute('ts_visible')) {
$db->query("UPDATE ezm_pool SET ts_hidden='" . $item->attribute('ts_hidden') . "',\n ts_visible='" . $item->attribute('ts_visible') . "' \n WHERE object_id='" . $item->attribute('object_id') . "'\n AND block_id='" . $blockID . "'");
}
break;
}
}
}
}
}
}
}
}
if (eZFlowOperations::updateOnPublish()) {
$nodeArray = array();
foreach ($publishedNodes as $node) {
$nodeArray[] = $node->attribute('node_id');
}
eZFlowOperations::update($nodeArray);
}
foreach ($publishedNodes as $node) {
$url = $node->attribute('path_identification_string');
eZURI::transformURI($url, false, 'full');
eZHTTPCacheManager::execute($url);
}
$page->removeProcessed();
$contentObjectAttribute->content($page);
$contentObjectAttribute->store();
return true;
}
示例5: onPublish
//.........这里部分代码省略.........
{
switch ( $item->attribute( 'action' ) )
{
case 'remove':
$db->query( "DELETE FROM ezm_pool
WHERE object_id='" . $item->attribute( 'object_id' ) . "'
AND block_id='" . $blockID . "'" );
break;
case 'add':
$newItems[] = array(
'blockID' => $blockID,
'objectID' => $item->attribute( 'object_id' ),
'nodeID' => $item->attribute( 'node_id' ),
'priority' => $item->attribute( 'priority' ),
'timestamp' => $item->attribute( 'ts_publication' ),
);
break;
case 'modify':
$updateQuery = array();
if ( $item->hasAttribute( 'ts_publication' ) )
{
$updateQuery[] = " ts_publication="
. (int)$item->attribute( 'ts_publication' );
}
//make sure to update different node locations of the same object
if ( $item->hasAttribute( 'node_id' ) )
{
$updateQuery[] = " node_id="
. (int)$item->attribute( 'node_id' );
}
if ( $item->hasAttribute( 'priority' ) )
{
$updateQuery[] = " priority="
. (int)$item->attribute( 'priority' );
}
//if there is ts_hidden and ts_visible, update the two fields. This is the case when add items from history
if ( $item->hasAttribute( 'ts_hidden' ) && $item->hasAttribute( 'ts_visible' ) )
{
$updateQuery[] = " ts_hidden="
. (int)$item->attribute( 'ts_hidden' )
. ", ts_visible="
. (int)$item->attribute( 'ts_visible' );
}
if ( !empty( $updateQuery ) )
{
$db->query(
"UPDATE ezm_pool SET "
. join( ", ", $updateQuery )
. " WHERE object_id="
. (int)$item->attribute( 'object_id' )
. " AND block_id='" . $blockID ."'"
);
}
break;
}
}
}
}
if ( !empty( $newItems ) )
{
eZFlowPool::insertItems( $newItems );
}
}
}
}
}
if ( eZFlowOperations::updateOnPublish() )
{
$nodeArray = array();
foreach ( $publishedNodes as $node )
{
$nodeArray[] = $node->attribute( 'node_id' );
}
eZFlowOperations::update( $nodeArray );
}
foreach ( $publishedNodes as $node )
{
$url = $node->attribute( 'path_identification_string' );
eZURI::transformURI( $url, false, 'full' );
eZHTTPCacheManager::execute( $url );
}
$page->removeProcessed();
$contentObjectAttribute->content( $page );
$contentObjectAttribute->store();
return true;
}