本文整理汇总了PHP中eZContentObjectVersion::definition方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectVersion::definition方法的具体用法?PHP eZContentObjectVersion::definition怎么用?PHP eZContentObjectVersion::definition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObjectVersion
的用法示例。
在下文中一共展示了eZContentObjectVersion::definition方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeDrafts
function removeDrafts($user)
{
$list = eZPersistentObject::fetchObjectList(eZContentObjectVersion::definition(), null, array('creator_id' => $user->id(), 'status' => array(EZ_VERSION_STATUS_DRAFT, EZ_VERSION_STATUS_INTERNAL_DRAFT)), null, null, true);
foreach ($list as $item) {
$item->remove();
}
}
示例2: groupedUserDrafts
/**
* @return array
*/
static function groupedUserDrafts()
{
$return = array();
$user = eZUser::currentUser();
$fetchParameters = array('status' => array(array(eZContentObjectVersion::STATUS_DRAFT, eZContentObjectVersion::STATUS_INTERNAL_DRAFT)), 'creator_id' => $user->attribute('contentobject_id'));
$versions = eZPersistentObject::fetchObjectList(eZContentObjectVersion::definition(), null, $fetchParameters);
$return = array();
foreach ($versions as $version) {
$return[$version->attribute('contentobject_id')] = array('version' => $version, 'related' => array());
}
foreach ($return as $id => $entry) {
$eZObj = $entry['version']->attribute('contentobject');
switch ($eZObj->attribute('class_identifier')) {
case 'image':
$revese_related_objects = $eZObj->reverseRelatedObjectList(false, 0, false, array('AllRelations' => true));
foreach ($revese_related_objects as $rr_eZObj) {
if (isset($return[$rr_eZObj->attribute('id')])) {
$return[$rr_eZObj->attribute('id')]['related'][] = $entry['version'];
unset($return[$eZObj->attribute('id')]);
}
}
}
}
return array('result' => $return);
}
示例3: fetchVersionCount
public static function fetchVersionCount($contentObject)
{
if (!is_object($contentObject)) {
return array('result' => 0);
}
$versionList = eZPersistentObject::fetchObjectList(eZContentObjectVersion::definition(), array(), array('contentobject_id' => $contentObject->attribute('id')), false, null, false, false, array(array('operation' => 'count( * )', 'name' => 'count')));
return array('result' => $versionList[0]['count']);
}
示例4: array
}
$res = eZTemplateDesignResource::instance();
$res->setKeys(array(array('object', $object->attribute('id')), array('remote_id', $object->attribute('remote_id')), array('class', $object->attribute('contentclass_id')), array('class_identifier', $object->attribute('class_identifier')), array('section_id', $object->attribute('section_id')), array('section', $object->attribute('section_id'))));
// Section ID, 0 so far
$section = eZSection::fetch($object->attribute('section_id'));
if ($section) {
$res->setKeys(array(array('section_identifier', $section->attribute('identifier'))));
}
$versionArray = isset($versionArray) && is_array($versionArray) ? array_unique($versionArray, SORT_REGULAR) : array();
$LastAccessesVersionURI = $http->hasSessionVariable('LastAccessesVersionURI') ? $http->sessionVariable('LastAccessesVersionURI') : null;
$explodedURI = $LastAccessesVersionURI ? explode('/', $LastAccessesVersionURI) : null;
if ($LastAccessesVersionURI and is_array($versionArray) and !in_array($explodedURI[3], $versionArray)) {
$tpl->setVariable('redirect_uri', $http->sessionVariable('LastAccessesVersionURI'));
}
//Fetch newer drafts and count of newer drafts.
$newerDraftVersionList = eZPersistentObject::fetchObjectList(eZContentObjectVersion::definition(), null, array('contentobject_id' => $object->attribute('id'), 'status' => eZContentObjectVersion::STATUS_DRAFT, 'version' => array('>', $object->attribute('current_version'))), array('modified' => 'asc', 'initial_language_id' => 'desc'), null, true);
$newerDraftVersionListCount = is_array($newerDraftVersionList) ? count($newerDraftVersionList) : 0;
$versions = $object->versions();
$tpl->setVariable('newerDraftVersionList', $newerDraftVersionList);
$tpl->setVariable('newerDraftVersionListCount', $newerDraftVersionListCount);
$tpl->setVariable('view_parameters', $viewParameters);
$tpl->setVariable('object', $object);
$tpl->setVariable('edit_version', $EditVersion);
$tpl->setVariable('versions', $versions);
$tpl->setVariable('edit_warning', $editWarning);
$tpl->setVariable('can_edit', $canEdit);
//$tpl->setVariable( 'can_remove', $canRemove );
$tpl->setVariable('user_id', $user->attribute('contentobject_id'));
$Result = array();
$Result['content'] = $tpl->fetch('design:content/history.tpl');
$Result['path'] = array(array('text' => ezpI18n::tr('kernel/content', 'History'), 'url' => false));
示例5: versions
/**
* Returns an array of eZContentObjectVersion for the current object according to the conditions in $parameters.
*
* @param bool $asObject If true, returns an eZContentObjectVersion; if false, returns an array
* @param array $parameters
* @return eZContentObjectVersion[]|array
*/
function versions( $asObject = true, $parameters = array() )
{
$conditions = array( "contentobject_id" => $this->ID );
if ( isset( $parameters['conditions'] ) )
{
if ( isset( $parameters['conditions']['status'] ) )
$conditions['status'] = $parameters['conditions']['status'];
if ( isset( $parameters['conditions']['creator_id'] ) )
$conditions['creator_id'] = $parameters['conditions']['creator_id'];
if ( isset( $parameters['conditions']['language_code'] ) )
{
$conditions['initial_language_id'] = eZContentLanguage::idByLocale( $parameters['conditions']['language_code'] );
}
if ( isset( $parameters['conditions']['initial_language_id'] ) )
{
$conditions['initial_language_id'] = $parameters['conditions']['initial_language_id'];
}
}
$sort = isset( $parameters['sort'] ) ? $parameters['sort'] : null;
$limit = isset( $parameters['limit'] ) ? $parameters['limit'] : null;
return eZPersistentObject::fetchObjectList( eZContentObjectVersion::definition(),
null, $conditions,
$sort, $limit,
$asObject );
}
示例6: fetchFiltered
static function fetchFiltered( $filters, $offset, $limit )
{
$limits = null;
if ( $offset or $limit )
$limits = array( 'offset' => $offset,
'length' => $limit );
return eZPersistentObject::fetchObjectList( eZContentObjectVersion::definition(),
null, $filters,
null, $limits,
true );
}
示例7: array
) ); // Section ID, 0 so far
$section = eZSection::fetch( $object->attribute( 'section_id' ) );
if( $section )
{
$res->setKeys( array( array( 'section_identifier', $section->attribute( 'identifier' ) ) ) );
}
$versionArray =( isset( $versionArray ) and is_array( $versionArray ) ) ? array_unique( $versionArray ) : array();
$LastAccessesVersionURI = $http->hasSessionVariable( 'LastAccessesVersionURI' ) ? $http->sessionVariable( 'LastAccessesVersionURI' ) : null;
$explodedURI = $LastAccessesVersionURI ? explode ( '/', $LastAccessesVersionURI ) : null;
if ( $LastAccessesVersionURI and is_array( $versionArray ) and !in_array( $explodedURI[3], $versionArray ) )
$tpl->setVariable( 'redirect_uri', $http->sessionVariable( 'LastAccessesVersionURI' ) );
//Fetch newer drafts and count of newer drafts.
$newerDraftVersionList = eZPersistentObject::fetchObjectList( eZContentObjectVersion::definition(),
null,
array( 'contentobject_id' => $object->attribute( 'id' ),
'status' => eZContentObjectVersion::STATUS_DRAFT,
'version' => array( '>', $object->attribute( 'current_version' ) ) ),
array( 'modified' => 'asc',
'initial_language_id' => 'desc' ),
null, true );
$newerDraftVersionListCount = is_array( $newerDraftVersionList ) ? count( $newerDraftVersionList ) : 0;
$versions = $object->versions();
$tpl->setVariable( 'newerDraftVersionList', $newerDraftVersionList );
$tpl->setVariable( 'newerDraftVersionListCount', $newerDraftVersionListCount );
$tpl->setVariable( 'view_parameters', $viewParameters );
$tpl->setVariable( 'object', $object );
示例8: isset
$troubleshoot = isset($options['script-verbose-level']) && $options['script-verbose-level'] > 0 ? true : false;
$objectIDs = isset($options['object-ids']) && strlen($options['object-ids']) >= 1 ? explode(',', $options['object-ids']) : false;
$attributeIdentifiers = isset($options['attribute-identifiers']) && strlen($options['attribute-identifiers']) >= 1 ? explode(',', $options['attribute-identifiers']) : array('image');
$version = isset($options['version']) && strlen($options['version']) >= 1 ? $options['version'] : 'current';
$test = isset($options['test-only']) ? true : false;
$showSQL = isset($options['sql']) ? true : false;
/** Script default values **/
$adminUserID = 14;
$objectVersionsModified = array();
$offset = 0;
$limit = 1;
$status = true;
$resultCounter = 1;
$asObject = true;
$contentObjectDefinition = eZContentObject::definition();
$contentObjectVersionDefinition = eZContentObjectVersion::definition();
$contentObjectDefinitionContentObjectID = $contentObjectDefinition['name'] . '.id';
$contentObjectVersionDefinitionContentObjectID = $contentObjectVersionDefinition['name'] . '.id';
$conditions = null;
$customConds = ' WHERE ';
$countCustomConds = $customConds;
if ($version == 'current' || $version == 'new') {
$queryContentObjectXDefinition = $contentObjectDefinition;
$queryContentObjectXDefinitionContentObjectID = $contentObjectDefinitionContentObjectID;
$objectTypeName = 'objects';
$objectTypeVersionName = "{$version} version";
} elseif ($version == 'all') {
$queryContentObjectXDefinition = $contentObjectVersionDefinition;
$contentObjectVersionDefinitionContentObjectIDFieldName = str_replace('ez', '', $contentObjectDefinition['name']);
$queryContentObjectXDefinitionContentObjectID = $contentObjectVersionDefinition['name'] . "." . $contentObjectVersionDefinitionContentObjectIDFieldName . '_id';
$objectTypeName = 'object versions';
开发者ID:brookinsconsulting,项目名称:bcremoveobjectimageattributecontent,代码行数:31,代码来源:bcremoveobjectimageattributecontent.php