/** * 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); }
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)); } }
/** * Remove calculated ratings by content object id and optionally attribute id. * * @param int $contentobjectID * @param int $contentobjectAttributeId */ static function removeByObjectId($contentobjectID, $contentobjectAttributeId = null) { $cond = array('contentobject_id' => $contentobjectID); if ($contentobjectAttributeId !== null) { $cond['contentobject_attribute_id'] = $contentobjectAttributeId; } eZPersistentObject::removeObject(self::definition(), $cond); }
/** * Removes the objects from persistence which are related to content object attribute * defined by attribute ID and attribute version * * @static * * @param int $objectAttributeID * @param int|null $objectAttributeVersion */ public static function removeByAttribute($objectAttributeID, $objectAttributeVersion = null) { if (!is_numeric($objectAttributeID)) { return; } $conditions = array('objectattribute_id' => (int) $objectAttributeID); if (is_numeric($objectAttributeVersion)) { $conditions['objectattribute_version'] = (int) $objectAttributeVersion; } parent::removeObject(self::definition(), $conditions); }
static function removeByOAID($objectAttributeID, $objectAttributeVersion = null) { $db = eZDB::instance(); $db->begin(); if ($objectAttributeVersion == null) { eZPersistentObject::removeObject(eZMultiPriceData::definition(), array('contentobject_attr_id' => $objectAttributeID)); } else { eZPersistentObject::removeObject(eZMultiPriceData::definition(), array('contentobject_attr_id' => $objectAttributeID, 'contentobject_attr_version' => $objectAttributeVersion)); } $db->commit(); }
static function removeByValue($value, $policyID = false) { if ($policyID) { $limitationIDList = array(); $limitations = eZPolicyLimitation::fetchByPolicyID($policyID, false); foreach ($limitations as $limitationArray) { $limitationIDList[] = $limitationArray['id']; } if (count($limitationIDList) > 0) { eZPersistentObject::removeObject(eZPolicyLimitationValue::definition(), array('limitation_id' => array($limitationIDList), "value" => $value)); return; } } eZPersistentObject::removeObject(eZPolicyLimitationValue::definition(), array("value" => $value)); }
static function removeEmpty() { $db = eZDB::instance(); if ($db->databaseName() == 'oracle') { // fix for compatibility with Oracle versions prior to 9 $query = 'SELECT eznotificationcollection.id FROM eznotificationcollection, eznotificationcollection_item WHERE eznotificationcollection.id = eznotificationcollection_item.collection_id(+) AND eznotificationcollection_item.collection_id IS NULL'; } else { $query = 'SELECT eznotificationcollection.id FROM eznotificationcollection LEFT JOIN eznotificationcollection_item ON eznotificationcollection.id=eznotificationcollection_item.collection_id WHERE eznotificationcollection_item.collection_id IS NULL'; } $idArray = $db->arrayQuery($query); $db->begin(); foreach ($idArray as $id) { eZPersistentObject::removeObject(eZNotificationCollection::definition(), array('id' => $id['id'])); } $db->commit(); }
/** * Remove the given category and all references to it. * * \public * \static */ static function removeByID($id) { $id = (int) $id; $db = eZDB::instance(); $db->begin(); // Delete references to the category from VAT charging rules. eZVatRule::removeReferencesToProductCategory($id); // Reset product category attribute for all products // that have been referencing the category. $ini = eZINI::instance('shop.ini'); if ($ini->hasVariable('VATSettings', 'ProductCategoryAttribute') && ($categoryAttrName = $ini->variable('VATSettings', 'ProductCategoryAttribute'))) { $categoryAttrName = $db->escapeString($categoryAttrName); $query = "SELECT coa.id FROM ezcontentobject_attribute coa, ezcontentclass_attribute cca, ezcontentobject co " . "WHERE " . " cca.id=coa.contentclassattribute_id " . " AND coa.contentobject_id=co.id " . " AND cca.data_type_string='ezproductcategory' " . " AND cca.identifier='{$categoryAttrName}' " . " AND coa.version=co.current_version " . " AND coa.data_int={$id}"; $rows = $db->arrayQuery($query); foreach ($rows as $row) { $query = "UPDATE ezcontentobject_attribute SET data_int=0, sort_key_int=0 WHERE id=" . (int) $row['id']; $db->query($query); } } // Remove the category itself. eZPersistentObject::removeObject(eZProductCategory::definition(), array("id" => $id)); $db->commit(); }
static function removeByUserID($userID) { eZPersistentObject::removeObject(eZUserSetting::definition(), array('user_id' => $userID)); }
$module = $Params['Module']; $http = eZHTTPTool::instance(); $tpl = eZTemplate::factory(); if ($http->hasPostVariable('SaveRule_itnewsletter')) { // AGGIUNGO LA REGISTRAZIONE DELL'UTENTE AL TAG DELLA NEWSLETTER // $tagID = $http->postVariable('SaveRule_itnewsletter'); $user = eZUser::currentUser(); $existingTags = ITNewsletterNotificationRule::fetchTagsForUserID($user->attribute('contentobject_id'), false); if (!in_array($tagID, $existingTags)) { $rule = ITNewsletterNotificationRule::create($tagID, $user->attribute('contentobject_id')); $rule->store(); } } else { if ($http->hasPostVariable('RemoveRule_itnewsletter')) { // TOLGO LA REGISTRAZIONE DELL'UTENTE AL TAG DELLA NEWSLETTER // $user = eZUser::currentUser(); $listID = array(); $userList = ITNewsletterNotificationRule::fetchList($user->attribute('contentobject_id'), false); foreach ($userList as $userRow) { $listID[] = $userRow['id']; } $ruleIDList = $http->postVariable('RemoveRule_itnewsletter'); foreach ($ruleIDList as $ruleID) { if (in_array($ruleID, $listID)) { eZPersistentObject::removeObject(ITNewsletterNotificationRule::definition(), array('id' => $ruleID)); } } } } $Result['content'] = $tpl->fetch('design:ptn/newsletter.tpl'); $Result['path'] = array(array('url' => false, 'text' => 'Newsletter'));
static function removeForNode($nodeID) { eZPersistentObject::removeObject(eZTipafriendCounter::definition(), array('node_id' => $nodeID)); }
static function removeUser($userID) { $user = eZUser::fetch($userID); if (!$user) { eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__); return false; } eZUser::removeSessionData($userID); eZSubtreeNotificationRule::removeByUserID($userID); eZCollaborationNotificationRule::removeByUserID($userID); eZUserSetting::removeByUserID($userID); eZUserAccountKey::removeByUserID($userID); eZForgotPassword::removeByUserID($userID); eZWishList::removeByUserID($userID); eZGeneralDigestUserSettings::removeByUserId($userID); eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID)); return true; }
function removeAttributes($removeAttributes = false, $version = false) { if (is_array($removeAttributes)) { $db = eZDB::instance(); $db->begin(); foreach ($removeAttributes as $attribute) { $attribute->removeThis(); } $db->commit(); } else { $contentClassID = $this->ID; if ($version === false) { $version = $this->Version; } $classAttributes = $this->fetchAttributes(); $db = eZDB::instance(); $db->begin(); foreach ($classAttributes as $classAttribute) { $dataType = $classAttribute->dataType(); $dataType->deleteStoredClassAttribute($classAttribute, $version); } eZPersistentObject::removeObject(eZContentClassAttribute::definition(), array('contentclass_id' => $contentClassID, 'version' => $version)); $db->commit(); } }
static function removeSelected($id) { eZPersistentObject::removeObject(eZContentClassGroup::definition(), array("id" => $id)); }
static function removeByID( $urlID ) { eZPersistentObject::removeObject( eZURL::definition(), array( 'id' => $urlID ) ); }
static function removeByID($id) { eZPersistentObject::removeObject(eZISBNGroup::definition(), array('id' => $id)); }
static function removeEvents($events = false, $id = false, $version = false) { if (is_array($events)) { $db = eZDB::instance(); $db->begin(); foreach ($events as $event) { $event->remove(); } $db->commit(); } else { $condArray = array(); if ($version !== false) { $condArray['version'] = $version; } if ($id !== false) { $condArray['workflow_id'] = $id; } eZPersistentObject::removeObject(eZWorkflowEvent::definition(), $condArray); } }
/** * * * @param integer $id */ public static function removeByID($id) { $db = eZDB::instance(); $db->begin(); $states = eZContentObjectState::fetchByGroup($id); foreach ($states as $state) { eZContentObjectState::removeByID($state->attribute('id')); } eZPersistentObject::removeObject(eZContentObjectStateGroupLanguage::definition(), array('contentobject_state_group_id' => $id)); eZPersistentObject::removeObject(eZContentObjectStateGroup::definition(), array('id' => $id)); $db->commit(); }
/** * Removes a content object state by its numerical ID * * This method should not be used directly, instead use {@link eZContentObjectStateGroup::removeStatesByID()}. * * @param integer $id the numerical ID of the content object state */ public static function removeByID($id) { $db = eZDB::instance(); $db->begin(); $db->query("DELETE FROM ezcobj_state_link WHERE contentobject_state_id={$id}"); eZPersistentObject::removeObject(eZContentObjectStateLanguage::definition(), array('contentobject_state_id' => $id)); eZPersistentObject::removeObject(eZContentObjectState::definition(), array('id' => $id)); $db->commit(); }
function removeThis($id, $currentVersion = null) { $dataType = $this->dataType(); if (!$dataType) { return false; } $dataType->deleteStoredObjectAttribute($this, $currentVersion); if ($currentVersion == null) { eZPersistentObject::removeObject(eZContentObjectAttribute::definition(), array("id" => $id)); } else { eZPersistentObject::removeObject(eZContentObjectAttribute::definition(), array("id" => $id, "version" => $currentVersion)); } }
static function removeUser($userID) { $user = eZUser::fetch($userID); if (!$user) { eZDebug::writeError("unable to find user with ID {$userID}", __METHOD__); return false; } eZUser::removeSessionData($userID); eZSubtreeNotificationRule::removeByUserID($userID); eZCollaborationNotificationRule::removeByUserID($userID); eZUserSetting::removeByUserID($userID); eZUserAccountKey::removeByUserID($userID); eZForgotPassword::removeByUserID($userID); eZWishList::removeByUserID($userID); // only remove general digest setting if there are no other users with the same e-mail $email = $user->attribute('email'); $usersWithEmailCount = eZPersistentObject::count(eZUser::definition(), array('email' => $email)); if ($usersWithEmailCount == 1) { eZGeneralDigestUserSettings::removeByAddress($email); } eZPersistentObject::removeObject(eZUser::definition(), array('contentobject_id' => $userID)); return true; }
function removeThis() { $db = eZDB::instance(); $db->begin(); // Set all elements using this status to 0 (undefined). $statusID = (int) $this->StatusID; $db->query("UPDATE ezorder SET status_id = 0 WHERE status_id = {$statusID}"); $db->query("UPDATE ezorder_status_history SET status_id = 0 WHERE status_id = {$statusID}"); $id = $this->ID; eZPersistentObject::removeObject(eZOrderStatus::definition(), array("id" => $id)); $db->commit(); eZOrderStatus::flush(); }
function remove ( $id = null, $dumb = null ) { eZPersistentObject::removeObject( eZDiscountSubRule::definition(), array( "id" => $id ) ); }
static function removeBySubRuleID ( $discountSubRuleID ) { eZPersistentObject::removeObject( eZDiscountSubRuleValue::definition(), array( "discountsubrule_id" => $discountSubRuleID ) ); }
static function removeByID($id, $version) { if ($version == null) { eZPersistentObject::removeObject(eZMedia::definition(), array("contentobject_attribute_id" => $id)); } else { eZPersistentObject::removeObject(eZMedia::definition(), array("contentobject_attribute_id" => $id, "version" => $version)); } }
/** * Remove entries by action * @param string $action * @param array $filterConds Additional filter conditions, as supported by {@link eZPersistentObject::fetchObjectList()} ($conds param). * For consistency sake, if an 'action' key is set here, it won't be taken into account */ public static function removeByAction($action, array $filterConds = array()) { parent::removeObject(self::definition(), array('action' => $action) + $filterConds); }
/** * Purges the configuration rows for a given query string, a given object, or both. * * @param string $queryString Query string for which elevate configuration is removed * @param int $objectID Content object for which the elevate configuration is removed * @param string $languageCode Language code for which the elevate configuration is removed. Defaults to 'all languages' */ public static function purge($queryString = '', $objectID = null, $languageCode = null) { // check that some conditions were passed if ($queryString === '' and $objectID === null and $languageCode === null) { return false; } if ($queryString !== '') { $conds['search_query'] = $queryString; } if ($objectID !== null) { $conds['contentobject_id'] = $objectID; } if ($languageCode !== null) { $conds['language_code'] = $languageCode; } return parent::removeObject(self::definition(), $conds); }
/** * Remove given VAT charging rule. */ static function removeVatRule($id) { $db = eZDB::instance(); $db->begin(); // Remove product categories associated with the rule. eZVatRule::removeProductCategories($id); // Remove the rule itself. eZPersistentObject::removeObject(eZVatRule::definition(), array("id" => $id)); $db->commit(); }
static function removeByID($id) { eZPersistentObject::removeObject(eZISBNRegistrantRange::definition(), array('id' => $id)); }
/** * Removes wildcards based on an ID list * @param array $idList array of numerical ID * @return void */ public static function removeByIDs( $idList ) { if ( !is_array( $idList ) ) return; while ( count( $idList ) > 0 ) { // remove by portion of 100 rows. $ids = array_splice( $idList, 0, 100 ); $conditions = array( 'id' => array( $ids ) ); eZPersistentObject::removeObject( self::definition(), $conditions ); } }