本文整理汇总了PHP中eZPersistentObject::getShortAttributeName方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPersistentObject::getShortAttributeName方法的具体用法?PHP eZPersistentObject::getShortAttributeName怎么用?PHP eZPersistentObject::getShortAttributeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZPersistentObject
的用法示例。
在下文中一共展示了eZPersistentObject::getShortAttributeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleList
static function handleList( $parameters = array(), $asCount = false )
{
$parameters = array_merge( array( 'as_object' => true,
'is_valid' => null,
'offset' => false,
'limit' => false,
'only_published' => false ),
$parameters );
$asObject = $parameters['as_object'];
$isValid = $parameters['is_valid'];
$offset = $parameters['offset'];
$limit = $parameters['limit'];
$onlyPublished = $parameters['only_published'];
$limitArray = null;
if ( !$asCount and $offset !== false and $limit !== false )
$limitArray = array( 'offset' => $offset,
'length' => $limit );
$conditions = array();
if( $isValid === false ) $isValid = 0;
if ( $isValid !== null )
{
$conditions['is_valid'] = $isValid;
}
if ( count( $conditions ) == 0 )
$conditions = null;
if ( $onlyPublished ) // Only fetch published urls
{
$conditionQuery = "";
if ( $isValid !== null )
{
$isValid = (int) $isValid;
$conditionQuery = " AND ezurl.is_valid=$isValid ";
}
$db = eZDB::instance();
$cObjAttrVersionColumn = eZPersistentObject::getShortAttributeName( $db, eZURLObjectLink::definition(), 'contentobject_attribute_version' );
if ( $asCount )
{
$urls = $db->arrayQuery( "SELECT count( DISTINCT ezurl.id ) AS count
FROM
ezurl,
ezurl_object_link,
ezcontentobject_attribute,
ezcontentobject_version
WHERE
ezurl.id = ezurl_object_link.url_id
AND ezurl_object_link.contentobject_attribute_id = ezcontentobject_attribute.id
AND ezurl_object_link.$cObjAttrVersionColumn = ezcontentobject_attribute.version
AND ezcontentobject_attribute.contentobject_id = ezcontentobject_version.contentobject_id
AND ezcontentobject_attribute.version = ezcontentobject_version.version
AND ezcontentobject_version.status = " . eZContentObjectVersion::STATUS_PUBLISHED . "
$conditionQuery" );
return $urls[0]['count'];
}
else
{
$query = "SELECT DISTINCT ezurl.*
FROM
ezurl,
ezurl_object_link,
ezcontentobject_attribute,
ezcontentobject_version
WHERE
ezurl.id = ezurl_object_link.url_id
AND ezurl_object_link.contentobject_attribute_id = ezcontentobject_attribute.id
AND ezurl_object_link.$cObjAttrVersionColumn = ezcontentobject_attribute.version
AND ezcontentobject_attribute.contentobject_id = ezcontentobject_version.contentobject_id
AND ezcontentobject_attribute.version = ezcontentobject_version.version
AND ezcontentobject_version.status = " . eZContentObjectVersion::STATUS_PUBLISHED . "
$conditionQuery";
if ( !$offset && !$limit )
{
$urlArray = $db->arrayQuery( $query );
}
else
{
$urlArray = $db->arrayQuery( $query, array( 'offset' => $offset,
'limit' => $limit ) );
}
if ( $asObject )
{
$urls = array();
foreach ( $urlArray as $url )
{
$urls[] = new eZURL( $url );
}
return $urls;
}
else
$urls = $urlArray;
return $urls;
}
}
else
{
if ( $asCount )
{
$urls = eZPersistentObject::fetchObjectList( eZURL::definition(),
//.........这里部分代码省略.........