• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP eZPersistentObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: fetchList

 static function fetchList($conditions = null, $asObjects = true, $offset = false, $limit = false)
 {
     $limitation = null;
     if ($offset !== false or $limit !== false) {
         $limitation = array('offset' => $offset, 'length' => $limit);
     }
     return eZPersistentObject::fetchObjectList(eZProductCollectionItem::definition(), null, $conditions, null, $limitation, $asObjects);
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:8,代码来源:ezproductcollectionitem.php


示例17: fetchList

 static function fetchList()
 {
     $result = array();
     $conditions = array();
     $limitation = null;
     $asObject = true;
     return eZPersistentObject::fetchObjectList(eZSurveyRelatedConfig::definition(), null, $conditions, null, $limitation, $asObject);
 }
开发者ID:netbliss,项目名称:ezsurvey,代码行数:8,代码来源:ezsurveyrelatedconfig.php


示例18: fetchList

 static function fetchList($user_id = false, $asObject = true)
 {
     $conds = array();
     if ($user_id !== false and is_numeric($user_id)) {
         $conds["creator_id"] = $user_id;
     }
     return eZPersistentObject::fetchObjectList(eZContentClassGroup::definition(), null, $conds, null, null, $asObject);
 }
开发者ID:legende91,项目名称:ez,代码行数:8,代码来源:ezcontentclassgroup.php


示例19: fetchByObjectAttributeAndKeywordID

 /**
  * Fetches the eZTagsAttributeLinkObject object based on provided content object params and keyword ID
  *
  * @param integer $objectAttributeID
  * @param integer $objectAttributeVersion
  * @param integer $objectID
  * @param integer $keywordID
  * @return eZTagsAttributeLinkObject if found, false otherwise
  */
 static function fetchByObjectAttributeAndKeywordID($objectAttributeID, $objectAttributeVersion, $objectID, $keywordID)
 {
     $objects = eZPersistentObject::fetchObjectList(self::definition(), null, array('objectattribute_id' => $objectAttributeID, 'objectattribute_version' => $objectAttributeVersion, 'object_id' => $objectID, 'keyword_id' => $keywordID));
     if (is_array($objects) && !empty($objects)) {
         return $objects[0];
     } else {
         return false;
     }
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:18,代码来源:eztagsattributelinkobject.php


示例20: runOperation

 function runOperation(&$node)
 {
     $target_parent_node_id = $this->target_id;
     if (empty($target_parent_node_id)) {
         if ($this->move_to_depth >= $node->attribute('depth')) {
             return false;
         }
         // Find the correct target node for the specified depth
         $path_array = $node->attribute('path_array');
         $target_parent_node_id = $path_array[$this->move_to_depth - 1];
     }
     $assigned_nodes = $node->attribute('object')->attribute('assigned_nodes');
     // Find the target node
     foreach ($assigned_nodes as $target_node) {
         if ($target_node->attribute('parent_node_id') == $target_parent_node_id) {
             $target_node_id = $target_node->attribute('node_id');
             // Make sure target node is not us
             if ($node->attribute('node_id') == $target_node_id) {
                 return false;
             }
             $urlalias_list = eZURLAliasML::fetchByAction('eznode', $node->attribute('node_id'));
             $target_node_urlalias_list = eZURLAliasML::fetchByAction('eznode', $target_node_id);
             // Sanity check, this should never happen
             if (!isset($target_node_urlalias_list[0])) {
                 eZDebug::writeError('Found no url alias records for node with id ' . $target_node_id, 'batchtool/nodemerge');
                 return false;
             }
             $target_node_urlalias_id = $target_node_urlalias_list[0]->attribute('id');
             $target_parent_urlalias_id = $target_node_urlalias_list[0]->attribute('parent');
             $db = eZDB::instance();
             $db->begin();
             // Make sure any children nodes are moved to the new node
             foreach ($node->attribute('children') as $child) {
                 moveNode($child, $target_node_id);
             }
             // Make sure any bookmarks are moved to the new node
             $bookmark_list = eZPersistentObject::fetchObjectList(eZContentBrowseBookmark::definition(), null, array('node_id' => $node->attribute('node_id')));
             foreach ($bookmark_list as $bookmark) {
                 $bookmark->setAttribute('node_id', $target_node_id);
                 $bookmark->store();
             }
             // Remove the node in question
             $node->removeNodeFromTree(true);
             // Set up url alias redirects to the new node
             foreach ($urlalias_list as $url_alias) {
                 $url_alias->setAttribute('action', 'eznode:' . $target_node_id);
                 $url_alias->setAttribute('action_type', 'eznode');
                 $url_alias->setAttribute('link', $target_node_urlalias_id);
                 $url_alias->setAttribute('is_original', 0);
                 $url_alias->store();
             }
             $db->commit();
             return true;
         }
     }
     return false;
 }
开发者ID:informaticatrentina,项目名称:batchtool,代码行数:57,代码来源:nodemerge.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP eZPolicyLimitation类代码示例发布时间:2022-05-23
下一篇:
PHP eZPackage类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap