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); }
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]; }
static function fetch( $id, $asObject = true ) { return eZPersistentObject::fetchObject( eZWorkflowGroup::definition(), null, array( "id" => $id ), $asObject ); }
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); }
static function fetchByKey( $hashKey ) { return eZPersistentObject::fetchObject( eZForgotPassword::definition(), null, array( "hash_key" => $hashKey ), true ); }
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); }
static function fetch( $userID, $asObject = true ) { return eZPersistentObject::fetchObject( eZUserSetting::definition(), null, array('user_id' => $userID ), $asObject ); }
public static function fetchByNodeId( $nodeId ) { $conds = array( 'node_id' => $nodeId, ); return eZPersistentObject::fetchObject( self::definition(), null, $conds ); }
static function fetchByName( $name, $asObject = true ) { return eZPersistentObject::fetchObject( eZProductCategory::definition(), null, array( "name" => $name ), $asObject ); }
static function fetchByKey( $hashKey ) { return eZPersistentObject::fetchObject( eZUserAccountKey::definition(), null, array( 'hash_key' => $hashKey ), true ); }
static function fetch( $id, $asObject = true ) { return eZPersistentObject::fetchObject( eZDiscountSubRule::definition(), null, array( "id" => $id ), $asObject ); }
static function fetch( $id ) { return eZPersistentObject::fetchObject( eZVatRule::definition(), null, array( "id" => $id ), true ); }
static function fetchForUser( $address, $asObject = true ) { return eZPersistentObject::fetchObject( eZGeneralDigestUserSettings::definition(), null, array( 'address' => $address ), $asObject ); }
/** * 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); }
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); }
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); }
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); }
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); }
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); } }
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); } }
/** * 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); }
/** * 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 ); }
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 ); }
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]; }
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); }
/** * 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(); } }
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; }
/** * 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; }
/** * 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; }
static function fetch($nodeID, $asObject = true) { return eZPersistentObject::fetchObject(eZTipafriendCounter::definition(), null, array('node_id' => $nodeID), $asObject); }