コード例 #1
0
 function fetch($collaborationID, $groupID, $userID = false, $asObject = true)
 {
     if ($userID == false) {
         $userID == eZUser::currentUserID();
     }
     return eZPersistentObject::fetchObject(eZCollaborationItemGroupLink::definition(), null, array('collaboration_id' => $collaborationID, 'group_id' => $groupID, 'user_id' => $userID), $asObject);
 }
コード例 #2
0
 static function fetch($collaborationID, $participantID, $asObject = true)
 {
     if (empty($GLOBALS["eZCollaborationItemParticipantLinkCache"][$collaborationID][$participantID])) {
         $GLOBALS["eZCollaborationItemParticipantLinkCache"][$collaborationID][$participantID] = eZPersistentObject::fetchObject(eZCollaborationItemParticipantLink::definition(), null, array("collaboration_id" => $collaborationID, 'participant_id' => $participantID), $asObject);
     }
     return $GLOBALS["eZCollaborationItemParticipantLinkCache"][$collaborationID][$participantID];
 }
コード例 #3
0
 static function fetch( $id, $asObject = true )
 {
     return eZPersistentObject::fetchObject( eZWorkflowGroup::definition(),
                                             null,
                                             array( "id" => $id ),
                                             $asObject );
 }
コード例 #4
0
 static function fetchMain($mementoKey, $asObject = true)
 {
     if (is_array($mementoKey)) {
         $mementoKey = eZOperationMemento::createKey($mementoKey);
     }
     return eZPersistentObject::fetchObject(eZOperationMemento::definition(), null, array('memento_key' => $mementoKey, 'main' => 1), $asObject);
 }
コード例 #5
0
 static function fetchByKey( $hashKey )
 {
     return eZPersistentObject::fetchObject( eZForgotPassword::definition(),
                                             null,
                                             array( "hash_key" => $hashKey ),
                                             true );
 }
コード例 #6
0
ファイル: ezvattype.php プロジェクト: netbliss/ezpublish
 static function fetch($id, $asObject = true)
 {
     if ($id == -1 && eZVATManager::isDynamicVatChargingEnabled()) {
         return eZVatType::dynamicVatType($asObject);
     }
     return eZPersistentObject::fetchObject(eZVatType::definition(), null, array("id" => $id), $asObject);
 }
コード例 #7
0
 static function fetch( $userID,  $asObject = true  )
 {
     return eZPersistentObject::fetchObject( eZUserSetting::definition(),
                                                 null,
                                                 array('user_id' => $userID ),
                                                 $asObject );
 }
コード例 #8
0
 public static function fetchByNodeId( $nodeId )
 {
     $conds = array(
         'node_id'       => $nodeId,
     );
     return eZPersistentObject::fetchObject( self::definition(), null, $conds );
 }
コード例 #9
0
 static function fetchByName( $name, $asObject = true )
 {
     return eZPersistentObject::fetchObject( eZProductCategory::definition(),
                                             null,
                                             array( "name" => $name ),
                                             $asObject );
 }
コード例 #10
0
 static function fetchByKey( $hashKey )
 {
     return eZPersistentObject::fetchObject( eZUserAccountKey::definition(),
                                             null,
                                             array( 'hash_key' => $hashKey ),
                                             true );
 }
コード例 #11
0
 static function fetch( $id, $asObject = true )
 {
     return eZPersistentObject::fetchObject( eZDiscountSubRule::definition(),
                                             null,
                                             array( "id" => $id ),
                                             $asObject );
 }
コード例 #12
0
ファイル: ezvatrule.php プロジェクト: robinmuilwijk/ezpublish
 static function fetch( $id )
 {
     return eZPersistentObject::fetchObject( eZVatRule::definition(),
                                             null,
                                             array( "id" => $id ),
                                             true );
 }
コード例 #13
0
 static function fetchForUser( $address, $asObject = true )
 {
     return eZPersistentObject::fetchObject( eZGeneralDigestUserSettings::definition(),
                                             null,
                                             array( 'address' => $address ),
                                             $asObject );
 }
コード例 #14
0
ファイル: eztagskeyword.php プロジェクト: oki34/eztags
 /**
  * Returns eZTagsKeyword object for given tag ID and locale
  *
  * @static
  *
  * @param int $tagID
  * @param string $locale
  * @param bool $includeDrafts
  *
  * @return eZTagsKeyword
  */
 public static function fetch($tagID, $locale, $includeDrafts = false)
 {
     $fetchParams = array('keyword_id' => $tagID, 'locale' => $locale);
     if (!$includeDrafts) {
         $fetchParams['status'] = self::STATUS_PUBLISHED;
     }
     return parent::fetchObject(self::definition(), null, $fetchParams);
 }
コード例 #15
0
 static function fetch($id, $userID = false, $asObject = true)
 {
     $conditions = array("id" => $id);
     if ($userID !== false) {
         $conditions['user_id'] = $userID;
     }
     return eZPersistentObject::fetchObject(eZCollaborationGroup::definition(), null, $conditions, $asObject);
 }
コード例 #16
0
 static function fetchByFilepath($contentObjectAttributeID, $filepath, $asObject = true)
 {
     // Fetch by file path without $contentObjectAttributeID
     if ($contentObjectAttributeID === false) {
         return eZPersistentObject::fetchObject(eZImageFile::definition(), null, array('filepath' => $filepath), $asObject);
     }
     return eZPersistentObject::fetchObject(eZImageFile::definition(), null, array('contentobject_attribute_id' => $contentObjectAttributeID, 'filepath' => $filepath), $asObject);
 }
コード例 #17
0
 static function fetch($id, $creatorID = false, $asObject = true)
 {
     $conditions = array('id' => $id);
     if ($creatorID !== false) {
         $conditions['creator_id'] = $creatorID;
     }
     return eZPersistentObject::fetchObject(eZCollaborationItem::definition(), null, $conditions, $asObject);
 }
コード例 #18
0
ファイル: ezcontentclassgroup.php プロジェクト: legende91/ez
 static function fetch($id, $user_id = false, $asObject = true)
 {
     $conds = array("id" => $id);
     if ($user_id !== false and is_numeric($user_id)) {
         $conds["creator_id"] = $user_id;
     }
     return eZPersistentObject::fetchObject(eZContentClassGroup::definition(), null, $conds, $asObject);
 }
コード例 #19
0
 static function fetch($id, $version, $asObject = true)
 {
     if ($version == null) {
         return eZPersistentObject::fetchObjectList(ezflowMedia::definition(), null, array("contentobject_attribute_id" => $id), null, null, $asObject);
     } else {
         return eZPersistentObject::fetchObject(ezflowMedia::definition(), null, array("contentobject_attribute_id" => $id, "version" => $version), $asObject);
     }
 }
コード例 #20
0
ファイル: ezmedia.php プロジェクト: CG77/ezpublish-legacy
 static function fetchByFileName($filename, $version = null, $asObject = true)
 {
     if ($version == null) {
         return eZPersistentObject::fetchObjectList(eZMedia::definition(), null, array('filename' => $filename), null, null, $asObject);
     } else {
         return eZPersistentObject::fetchObject(eZMedia::definition(), null, array('filename' => $filename, 'version' => $version), $asObject);
     }
 }
コード例 #21
0
 /**
  * Return valid eZRSSExport object for a specific node if it exists.
  *
  * @param int $nodeID
  * @return eZRSSExport|false Return value is inside a array with return value on result, as this is used as template fetch function.
  */
 static function exportByNode($nodeID)
 {
     if (!$nodeID) {
         return array('error' => array('error_type' => 'kernel', 'error_code' => eZError::KERNEL_NOT_FOUND));
     }
     $rssExport = eZPersistentObject::fetchObject(eZRSSExport::definition(), null, array('node_id' => $nodeID, 'status' => eZRSSExport::STATUS_VALID), true);
     return array('result' => $rssExport);
 }
コード例 #22
0
 /**
  * Return the eZUserAccountKey object associated to a user id
  *
  * @param int $userID
  * @return eZUserAccountKey
  */
 static public function fetchByUserID( $userID )
 {
     return eZPersistentObject::fetchObject(
         eZUserAccountKey::definition(),
         null,
         array( 'user_id' => $userID ),
         true
     );
 }
コード例 #23
0
 static function fetch( $urlID, $contentObjectAttributeID, $contentObjectAttributeVersion, $asObject = true )
 {
     return eZPersistentObject::fetchObject( eZURLObjectLink::definition(),
                                             null,
                                             array( 'url_id' => $urlID,
                                                    'contentobject_attribute_id' => $contentObjectAttributeID,
                                                    'contentobject_attribute_version' => $contentObjectAttributeVersion ),
                                             $asObject );
 }
コード例 #24
0
 static function fetch($collaborationID, $userID = false, $asObject = true)
 {
     if ($userID === false) {
         $userID = eZUser::currentUserID();
     }
     if (!isset($GLOBALS['eZCollaborationItemStatusCache'][$collaborationID][$userID])) {
         $conditions = array('collaboration_id' => $collaborationID, 'user_id' => $userID);
         $GLOBALS['eZCollaborationItemStatusCache'][$collaborationID][$userID] = eZPersistentObject::fetchObject(eZCollaborationItemStatus::definition(), null, $conditions, $asObject);
     }
     return $GLOBALS['eZCollaborationItemStatusCache'][$collaborationID][$userID];
 }
コード例 #25
0
 static function fetchByUserID($userID, $approveID, $approveStatus, $hash = false, $asObject = true)
 {
     $cond = array('user_id' => $userID, 'approve_id' => $approveID);
     if ($approveStatus !== false) {
         $cond['approve_role'] = $approveStatus;
     }
     if ($hash !== false) {
         $cond['hash'] = $hash;
     }
     return eZPersistentObject::fetchObject(eZXApproveStatusUserLink::definition(), null, $cond, $asObject);
 }
コード例 #26
0
 /**
  * Registers import handler that is currently processed
  * @param string $handlerName
  */
 public static function setCurrentHandler($handlerName)
 {
     // First check if a current handler is already registered
     $handlerToken = parent::fetchObject(self::definition(), null, array('name' => self::CURRENT_HANDLER_FIELD_NAME));
     if ($handlerToken instanceof SQLIImportToken) {
         $handlerToken->setAttribute('value', $handlerName);
     } else {
         $row = array('name' => self::CURRENT_HANDLER_FIELD_NAME, 'value' => $handlerName);
         $handlerToken = new self($row);
         $handlerToken->store();
     }
 }
コード例 #27
0
 function execute($process, $event)
 {
     $parameters = $process->attribute('parameter_list');
     $co = eZContentObject::fetch($parameters['object_id']);
     $parent = eZContentObjectTreeNode::fetch($co->attribute('main_parent_node_id'));
     $parentco = $parent->attribute('object');
     $newslettertype = eZPersistentObject::fetchObject(eZNewsletterType::definition(), null, array('article_pool_object_id' => $parentco->attribute('id'), 'status' => eZNewsletterType_StatusPublished));
     $list = eZNewsletter::fetchByContentObject($parameters['object_id']);
     if (empty($list) and is_object($newslettertype)) {
         $newsletter = eZNewsletter::create($co->attribute('name'), $co->attribute('owner_id'), $newslettertype->attribute('id'));
         $newsletter->setAttribute('contentobject_id', $parameters['object_id']);
         $newsletter->setAttribute('template_to_use', 'mobotixnewsletter');
         $newsletter->setAttribute('contentobject_version', $parameters['version']);
         $newsletter->store();
         $newsletter->publish();
     }
     return eZWorkflowType::STATUS_ACCEPTED;
 }
コード例 #28
0
ファイル: ezsection.php プロジェクト: runelangseid/ezpublish
 /**
  * fetch object by section identifier
  * @param string $sectionIdentifier
  * @param boolean $asObject
  * @return object|null
  */
 static function fetchByIdentifier($sectionIdentifier, $asObject = true)
 {
     global $eZContentSectionObjectCache;
     if (!isset($eZContentSectionObjectCache[$sectionIdentifier]) || $asObject === false) {
         $sectionFetched = eZPersistentObject::fetchObject(eZSection::definition(), null, array("identifier" => $sectionIdentifier), $asObject);
         if ($asObject) {
             // the section identifier index refers to the id index object
             $sectionID = $sectionFetched->attribute('id');
             if (!isset($eZContentSectionObjectCache[$sectionID])) {
                 $eZContentSectionObjectCache[$sectionID] = $sectionFetched;
             }
             $eZContentSectionObjectCache[$sectionIdentifier] = $eZContentSectionObjectCache[$sectionID];
         } else {
             return $sectionFetched;
         }
     }
     $section = $eZContentSectionObjectCache[$sectionIdentifier];
     return $section;
 }
コード例 #29
0
 /**
  * Adds an elevate configuration row, optionnally for a given language.
  *
  * @param string $queryString Query string for which elevate configuration is added
  * @param int $objectID Content object for which the elevate configuration is added
  * @param string $languageCode Language code for which the elevate configuration is added. Defaults to 'all languages'
  */
 public static function add($queryString, $objectID, $languageCode = self::WILDCARD)
 {
     $db = eZDB::instance();
     $queryString = $db->escapeString($queryString);
     if ($languageCode === self::WILDCARD) {
         self::purge($queryString, $objectID);
     } else {
         // trying to insert an elevate configuration row for a specific language, while one already exists for all languages.
         if (parent::fetchObject(self::definition(), null, array('contentobject_id' => $objectID, 'search_query' => $queryString, 'language_code' => self::WILDCARD))) {
             return null;
         }
     }
     $row = array('search_query' => $queryString, 'contentobject_id' => $objectID, 'language_code' => $languageCode);
     $conf = new eZFindElevateConfiguration($row);
     $conf->store();
     return $conf;
 }
コード例 #30
0
ファイル: eztipafriendcounter.php プロジェクト: legende91/ez
 static function fetch($nodeID, $asObject = true)
 {
     return eZPersistentObject::fetchObject(eZTipafriendCounter::definition(), null, array('node_id' => $nodeID), $asObject);
 }