当前位置: 首页>>代码示例>>PHP>>正文


PHP eZPersistentObject类代码示例

本文整理汇总了PHP中eZPersistentObject的典型用法代码示例。如果您正苦于以下问题:PHP eZPersistentObject类的具体用法?PHP eZPersistentObject怎么用?PHP eZPersistentObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了eZPersistentObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetchForUser

 static function fetchForUser( $address, $asObject = true )
 {
     return eZPersistentObject::fetchObject( eZGeneralDigestUserSettings::definition(),
                                             null,
                                             array( 'address' => $address ),
                                             $asObject );
 }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:7,代码来源:ezgeneraldigestusersettings.php

示例2: 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);
 }
开发者ID:legende91,项目名称:ez,代码行数:35,代码来源:ezoeserverfunctions.php

示例3: 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);
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:7,代码来源:ezcollaborationitemgrouplink.php

示例4: 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();
     }
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:7,代码来源:eznewsletteraddons.php

示例5: fetchClassListByGroups

    function fetchClassListByGroups( $groupFilter, $groupFilterType = 'include' )
    {
        $notIn = ( $groupFilterType == 'exclude' );

        if ( is_array( $groupFilter ) && count( $groupFilter ) > 0 )
        {
            $db = eZDB::instance();
            $groupFilter = $db->generateSQLINStatement( $groupFilter, 'ccg.group_id', $notIn );

            $classNameFilter = eZContentClassName::sqlFilter( 'cc' );
            $version = eZContentClass::VERSION_STATUS_DEFINED;

            $sql = "SELECT DISTINCT cc.*, $classNameFilter[nameField] " .
                   "FROM ezcontentclass cc, ezcontentclass_classgroup ccg, $classNameFilter[from] " .
                   "WHERE cc.version = $version" .
                   "      AND cc.id = ccg.contentclass_id" .
                   "      AND $groupFilter" .
                   "      AND $classNameFilter[where] " .
                   "ORDER BY $classNameFilter[nameField] ASC";

            $rows = $db->arrayQuery( $sql );
            $classes = eZPersistentObject::handleRows( $rows, 'eZContentClass', true );
        }
        else
        {
            $classes = eZContentClass::fetchList( eZContentClass::VERSION_STATUS_DEFINED, true, false, array( 'name' => 'asc' ) );
        }

        return array( 'result' => $classes );
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:ezclassfunctioncollection.php

示例6: 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);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:7,代码来源:ezoperationmemento.php

示例7: 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;
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:29,代码来源:ezcollaborationitemparticipantlink.php

示例8: 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];
     }
 }
开发者ID:hudri,项目名称:cjw_newsletter,代码行数:14,代码来源:cjwnewsletteredition.php

示例9: 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);
 }
开发者ID:pkamps,项目名称:mugo_bootstrap_admin,代码行数:28,代码来源:MugoBootStrapAdminFunctions.php

示例10: 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);
 }
开发者ID:legende91,项目名称:ez,代码行数:7,代码来源:ezenumvalue.php

示例11: removeByID

 static function removeByID($id, $version)
 {
     if ($version == null) {
         eZPersistentObject::removeObject(eZBinaryFile::definition(), array('contentobject_attribute_id' => $id));
     } else {
         eZPersistentObject::removeObject(eZBinaryFile::definition(), array('contentobject_attribute_id' => $id, 'version' => $version));
     }
 }
开发者ID:patrickallaert,项目名称:ezpublish-legacy-php7,代码行数:8,代码来源:ezbinaryfile.php

示例12: unLock

function unLock(eZContentObject $object)
{
    $filterConds = array('action' => 'creating_translation', 'param' => $object->attribute('id'));
    $rows = eZPersistentObject::fetchObjectList(eZPendingActions::definition(), null, $filterConds);
    foreach ($rows as $row) {
        $row->remove();
    }
}
开发者ID:rantoniazzi,项目名称:ocbootstrap,代码行数:8,代码来源:translate.php

示例13: connections

 /**
  * Returns all of eZ Publish users connections to social networks
  *
  * @param int $userID
  *
  * @return bool
  */
 static function connections($userID)
 {
     $result = eZPersistentObject::fetchObjectList(self::definition(), null, array('user_id' => $userID));
     if (is_array($result) && !empty($result)) {
         return $result;
     }
     return array();
 }
开发者ID:netgen,项目名称:ngconnect,代码行数:15,代码来源:ngconnect.php

示例14: removeByAttribute

 /**
  * Removes the data from the table by attribute
  *
  * @param int $contentObjectAttributeId
  * @param int $contentObjectAttributeVersion
  */
 static function removeByAttribute($contentObjectAttributeId, $contentObjectAttributeVersion = null)
 {
     $conditions = array('contentobject_attribute_id' => $contentObjectAttributeId);
     if ($contentObjectAttributeVersion !== null) {
         $conditions['contentobject_attribute_version'] = $contentObjectAttributeVersion;
     }
     eZPersistentObject::removeObject(self::definition(), $conditions);
 }
开发者ID:netgen,项目名称:enhancedselection2,代码行数:14,代码来源:sckenhancedselection.php

示例15: 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);
 }
开发者ID:nxc,项目名称:nxc_string,代码行数:8,代码来源:limitation.php


注:本文中的eZPersistentObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。