本文整理汇总了PHP中eZPersistentObject::fetchObjectList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPersistentObject::fetchObjectList方法的具体用法?PHP eZPersistentObject::fetchObjectList怎么用?PHP eZPersistentObject::fetchObjectList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZPersistentObject
的用法示例。
在下文中一共展示了eZPersistentObject::fetchObjectList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchByAction
/**
* Fetches a pending actions list by action name
* @param string $action
* @param array $aCreationDateFilter Created date filter array (default is empty array). Must be a 2 entries array.
* First entry is the filter token (can be '=', '<', '<=', '>', '>=')
* Second entry is the filter value (timestamp)
* @return array|null Array of eZPendingActions or null if no entry has been found
*/
public static function fetchByAction( $action, array $aCreationDateFilter = array() )
{
$filterConds = array( 'action' => $action );
// Handle creation date filter
if( !empty( $aCreationDateFilter ) )
{
if( count( $aCreationDateFilter ) != 2 )
{
eZDebug::writeError( __CLASS__.'::'.__METHOD__.' : Wrong number of entries for Creation date filter array' );
return null;
}
list( $filterToken, $filterValue ) = $aCreationDateFilter;
$aAuthorizedFilterTokens = array( '=', '<', '>', '<=', '>=' );
if( !is_string( $filterToken ) || !in_array( $filterToken, $aAuthorizedFilterTokens ) )
{
eZDebug::writeError( __CLASS__.'::'.__METHOD__.' : Wrong filter type for creation date filter' );
return null;
}
$filterConds['created'] = array( $filterToken, $filterValue );
}
$result = parent::fetchObjectList( self::definition(), null, $filterConds );
return $result;
}
示例2: fetchList
static function fetchList($mementoKey, $asObject = true)
{
if (is_array($mementoKey)) {
$mementoKey = eZOperationMemento::createKey($mementoKey);
}
return eZPersistentObject::fetchObjectList(eZOperationMemento::definition(), null, array('memento_key' => $mementoKey, 'main' => 0), null, null, $asObject);
}
示例3: fetch
static function fetch($contentAttributeID, $contentObjectVersion, $currencyCode = false, $type = false, $asObjects = true)
{
$priceList = null;
$conds = array();
$conds['contentobject_attr_id'] = $contentAttributeID;
$conds['contentobject_attr_version'] = $contentObjectVersion;
if (is_array($currencyCode)) {
$conds['currency_code'] = array($currencyCode);
} else {
if ($currencyCode != false) {
$conds['currency_code'] = $currencyCode;
}
}
if (is_array($type)) {
$conds['type'] = array($type);
} else {
if ($type != false) {
$conds['type'] = $type;
}
}
$sort = null;
$limitation = null;
$rows = eZPersistentObject::fetchObjectList(eZMultiPriceData::definition(), null, $conds, $sort, $limitation, $asObjects);
if (count($rows) > 0) {
$keys = array_keys($rows);
foreach ($keys as $key) {
if ($asObjects) {
$priceList[$rows[$key]->attribute('currency_code')] = $rows[$key];
} else {
$priceList[$rows[$key]['currency_code']] = $rows[$key];
}
}
}
return $priceList;
}
示例4: fetchImageAttributesByFilepath
/**
* Looks up ezcontentobjectattribute entries matching an image filepath and
* a contentobjectattribute ID
*
* @param string $filePath file path to look up as URL in the XML string
* @param int $contentObjectAttributeID
*
* @return array An array of content object attribute ids and versions of
* image files where the url is referenced
*
* @todo Rewrite ! A where data_text LIKE '%xxx%' is a resource hog !
*/
static function fetchImageAttributesByFilepath($filepath, $contentObjectAttributeID)
{
$db = eZDB::instance();
$contentObjectAttributeID = (int) $contentObjectAttributeID;
$cond = array('id' => $contentObjectAttributeID);
$fields = array('contentobject_id', 'contentclassattribute_id');
$limit = array('offset' => 0, 'length' => 1);
$rows = eZPersistentObject::fetchObjectList(eZContentObjectAttribute::definition(), $fields, $cond, null, $limit, false);
if (count($rows) != 1) {
return array();
}
$contentObjectID = (int) $rows[0]['contentobject_id'];
$contentClassAttributeID = (int) $rows[0]['contentclassattribute_id'];
// Transform ", &, < and > to entities since they are being transformed in entities by DOM
// See eZImageAliasHandler::initialize()
// Ref https://jira.ez.no/browse/EZP-20090
$filepath = $db->escapeString(htmlspecialchars($filepath, version_compare(PHP_VERSION, '5.4.0', '>=') ? ENT_COMPAT | ENT_HTML401 : ENT_COMPAT, 'UTF-8'));
// Escape _ in like to avoid it to act as a wildcard !
$filepath = addcslashes($filepath, "_");
$query = "SELECT id, version\n FROM ezcontentobject_attribute\n WHERE contentobject_id = {$contentObjectID} AND\n contentclassattribute_id = {$contentClassAttributeID} AND\n data_text LIKE '%url=\"{$filepath}\"%'";
if ($db->databaseName() == 'oracle') {
$query .= " ESCAPE '\\'";
}
$rows = $db->arrayQuery($query);
return $rows;
}
示例5: fetchParticipantList
static function fetchParticipantList($parameters = array())
{
$parameters = array_merge(array('as_object' => true, 'item_id' => false, 'offset' => false, 'limit' => false, 'sort_by' => false), $parameters);
$cacheHashKey = md5(serialize($parameters));
if (isset($GLOBALS['eZCollaborationItemParticipantLinkListCache'][$cacheHashKey])) {
return $GLOBALS['eZCollaborationItemParticipantLinkListCache'][$cacheHashKey];
}
$itemID = $parameters['item_id'];
$asObject = $parameters['as_object'];
$offset = $parameters['offset'];
$limit = $parameters['limit'];
$linkList = null;
$limitArray = null;
if ($offset and $limit) {
$limitArray = array('offset' => $offset, 'length' => $limit);
}
$linkList = eZPersistentObject::fetchObjectList(eZCollaborationItemParticipantLink::definition(), null, array("collaboration_id" => $itemID), null, $limitArray, $asObject);
foreach ($linkList as $linkItem) {
if ($asObject) {
$participantID = $linkItem->attribute('participant_id');
} else {
$participantID = $linkItem['participant_id'];
}
if (!isset($GLOBALS["eZCollaborationItemParticipantLinkCache"][$itemID][$participantID])) {
$GLOBALS["eZCollaborationItemParticipantLinkCache"][$itemID][$participantID] = $linkItem;
}
}
return $GLOBALS['eZCollaborationItemParticipantLinkListCache'][$cacheHashKey] = $linkList;
}
示例6: fetch
/**
* Used in datatype cjwnewsletter_list
*
* @param unknown_type $attributeId
* @param unknown_type $version
* @return CjwNewsletterEdition
*/
static function fetch($attributeId, $version)
{
$objectList = eZPersistentObject::fetchObjectList(CjwNewsletterEdition::definition(), null, array('contentobject_attribute_id' => $attributeId, 'contentobject_attribute_version' => $version), null, null, true);
if (count($objectList) > 0) {
return $objectList[0];
}
}
示例7: 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);
}
示例8: fetchList
function fetchList($collaborationID, $userID = false, $asObject = true)
{
if ($userID == false) {
$userID == eZUser::currentUserID();
}
return eZPersistentObject::fetchObjectList(eZCollaborationItemGroupLink::definition(), null, array('collaboration_id' => $collaborationID, 'user_id' => $userID), null, null, $asObject);
}
示例9: bookmarks
/**
* Gets current users bookmarks by offset and limit
*
* @param array $args 0 => offset:0, 1 => limit:10
* @return hash
*/
public static function bookmarks($args)
{
$offset = isset($args[0]) ? (int) $args[0] : 0;
$limit = isset($args[1]) ? (int) $args[1] : 10;
$http = eZHTTPTool::instance();
$user = eZUser::currentUser();
$sort = 'desc';
if (!$user instanceof eZUser) {
throw new ezcBaseFunctionalityNotSupportedException('Bookmarks retrival', 'current user object is not of type eZUser');
}
$userID = $user->attribute('contentobject_id');
if ($http->hasPostVariable('SortBy') && $http->postVariable('SortBy') !== 'asc') {
$sort = 'asc';
}
// fetch bookmarks
$count = eZPersistentObject::count(eZContentBrowseBookmark::definition(), array('user_id' => $userID));
if ($count) {
$objectList = eZPersistentObject::fetchObjectList(eZContentBrowseBookmark::definition(), null, array('user_id' => $userID), array('id' => $sort), array('offset' => $offset, 'length' => $limit), true);
} else {
$objectList = false;
}
// Simplify node list so it can be encoded
if ($objectList) {
$list = ezjscAjaxContent::nodeEncode($objectList, array('loadImages' => true, 'fetchNodeFunction' => 'fetchNode', 'fetchChildrenCount' => true), 'raw');
} else {
$list = array();
}
return array('list' => $list, 'count' => $count ? count($objectList) : 0, 'total_count' => (int) $count, 'offset' => $offset, 'limit' => $limit);
}
示例10: 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();
}
}
示例11: fetchAllElements
static function fetchAllElements($classAttributeID, $version, $asObject = true)
{
if ($classAttributeID === null) {
return array();
}
return eZPersistentObject::fetchObjectList(eZEnumValue::definition(), null, array("contentclass_attribute_id" => $classAttributeID, "contentclass_attribute_version" => $version), null, null, $asObject);
}
示例12: fetchList
public static function fetchList($classAttributeID, $typeID = null)
{
$filters = array('class_attribute_id' => $classAttributeID);
if ($typeID !== null) {
$filters['type'] = $typeID;
}
return eZPersistentObject::fetchObjectList(self::definition(), null, $filters, true);
}
示例13: fetchList
static function fetchList()
{
$result = array();
$conditions = array();
$limitation = null;
$asObject = true;
return eZPersistentObject::fetchObjectList(eZSurveyRelatedConfig::definition(), null, $conditions, null, $limitation, $asObject);
}
示例14: fetchList
static function fetchList($newsletterTypeID, $subscriptionListID = false, $status = eZNewsletterType::StatusPublished, $asObject = true)
{
$condArray = array('newsletter_id' => $newsletterTypeID, 'status' => $status);
if ($subscriptionListID !== false) {
$condArray['subscription_id'] = $subscriptionListID;
}
return eZPersistentObject::fetchObjectList(eZNewsletterTypeSubscription::definition(), null, $condArray, null, null, $asObject);
}
示例15: fetchByFileName
static function fetchByFileName($filename, $version = null, $asObject = true)
{
if ($version == null) {
return eZPersistentObject::fetchObjectList(eZBinaryFile::definition(), null, array('filename' => $filename), null, null, $asObject);
} else {
return eZPersistentObject::fetchObject(eZBinaryFile::definition(), null, array('filename' => $filename, 'version' => $version), $asObject);
}
}