本文整理汇总了PHP中PartnerPeer::setUseCriteriaFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP PartnerPeer::setUseCriteriaFilter方法的具体用法?PHP PartnerPeer::setUseCriteriaFilter怎么用?PHP PartnerPeer::setUseCriteriaFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartnerPeer
的用法示例。
在下文中一共展示了PartnerPeer::setUseCriteriaFilter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPartners
function getPartners($lastPartner, $partnerLimitEachLoop)
{
PartnerPeer::clearInstancePool();
$c = new Criteria();
$c->add(PartnerPeer::ID, $lastPartner, Criteria::GREATER_THAN);
$c->addAscendingOrderByColumn(PartnerPeer::ID);
$c->setLimit($partnerLimitEachLoop);
PartnerPeer::setUseCriteriaFilter(false);
$partners = PartnerPeer::doSelect($c);
PartnerPeer::setUseCriteriaFilter(true);
return $partners;
}
示例2: getPartnersArray
private function getPartnersArray($partnerIds)
{
$allowed = array();
$c = new Criteria();
$c->addAnd(PartnerPeer::ID, $partnerIds, Criteria::IN);
$c->addAnd(PartnerPeer::STATUS, Partner::PARTNER_STATUS_ACTIVE, Criteria::EQUAL);
PartnerPeer::setUseCriteriaFilter(false);
$partners = PartnerPeer::doSelect($c);
PartnerPeer::setUseCriteriaFilter(true);
foreach ($partners as $partner) {
if (!in_array($partner->getId(), array(PartnerPeer::GLOBAL_PARTNER, Partner::ADMIN_CONSOLE_PARTNER_ID, Partner::BATCH_PARTNER_ID))) {
$allowed[] = array('id' => $partner->getId(), 'name' => $partner->getName());
}
}
return $allowed;
}
示例3: getPartnersArray
public static function getPartnersArray(array $partnerIds, Criteria $c = null)
{
$ret = array();
if (!$c) {
$c = new Criteria();
}
$c->addAnd(PartnerPeer::ID, $partnerIds, Criteria::IN);
$c->addAnd(PartnerPeer::STATUS, Partner::PARTNER_STATUS_ACTIVE, Criteria::EQUAL);
PartnerPeer::setUseCriteriaFilter(false);
$partners = PartnerPeer::doSelect($c);
PartnerPeer::setUseCriteriaFilter(true);
foreach ($partners as $partner) {
if (!in_array($partner->getId(), array(PartnerPeer::GLOBAL_PARTNER, Partner::ADMIN_CONSOLE_PARTNER_ID, Partner::BATCH_PARTNER_ID))) {
$ret[] = $partner;
}
}
return $ret;
}
示例4: reload
/**
* Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
*
* This will only work if the object has been saved and has a valid primary key set.
*
* @param boolean $deep (optional) Whether to also de-associated any related objects.
* @param PropelPDO $con (optional) The PropelPDO connection to use.
* @return void
* @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
*/
public function reload($deep = false, PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("Cannot reload a deleted object.");
}
if ($this->isNew()) {
throw new PropelException("Cannot reload an unsaved object.");
}
if ($con === null) {
$con = Propel::getConnection(PartnerPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
PartnerPeer::setUseCriteriaFilter(false);
$stmt = PartnerPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
PartnerPeer::setUseCriteriaFilter(true);
$row = $stmt->fetch(PDO::FETCH_NUM);
$stmt->closeCursor();
if (!$row) {
throw new PropelException('Cannot find matching row in the database to reload object values.');
}
$this->hydrate($row, 0, true);
// rehydrate
if ($deep) {
// also de-associate any related objects?
$this->akuser = null;
$this->colladminKusers = null;
$this->lastadminKuserCriteria = null;
}
// if (deep)
}
示例5: init
protected static function init()
{
kEventsManager::enableDeferredEvents(false);
MetadataProfilePeer::setUseCriteriaFilter(false);
MetadataPeer::setUseCriteriaFilter(false);
entryPeer::setUseCriteriaFilter(false);
uiConfPeer::setUseCriteriaFilter(false);
assetPeer::setUseCriteriaFilter(false);
PartnerPeer::setUseCriteriaFilter(false);
FileSyncPeer::setUseCriteriaFilter(false);
$options = getopt('hrl:p:o:b:e:', array('real-run', 'error-objects', 'old-versions', 'blocked-partners', 'files'));
if (isset($options['h'])) {
self::failWrongInputs();
}
if (isset($options['blocked-partners'])) {
self::$deleteDeletedPartnersFileSyncs = true;
}
if (isset($options['error-objects'])) {
self::$deleteErrorObjects = true;
}
if (isset($options['old-versions'])) {
self::$deleteOldVersions = true;
}
if (isset($options['files'])) {
self::$purgeDeletedFileSyncs = true;
}
if (isset($options['r']) || isset($options['real-run'])) {
self::$dryRun = false;
}
KalturaStatement::setDryRun(self::$dryRun);
$cacheFilePath = kConf::get('cache_root_path') . '/scripts/deleteOldContent.cache';
if (file_exists($cacheFilePath)) {
$cache = unserialize(file_get_contents($cacheFilePath));
if (isset($cache['oldVersionsStartUpdatedAt'])) {
self::$oldVersionsStartUpdatedAt = $cache['oldVersionsStartUpdatedAt'];
}
if (isset($cache['purgeStartUpdatedAt'])) {
self::$purgeStartUpdatedAt = $cache['purgeStartUpdatedAt'];
}
}
if (!self::$purgeStartUpdatedAt) {
$criteria = new Criteria();
$criteria->add(FileSyncPeer::UPDATED_AT, 0, Criteria::GREATER_THAN);
$criteria->add(FileSyncPeer::DC, kDataCenterMgr::getCurrentDcId());
$criteria->add(FileSyncPeer::STATUS, FileSync::FILE_SYNC_STATUS_DELETED);
$criteria->addSelectColumn('UNIX_TIMESTAMP(MIN(' . FileSyncPeer::UPDATED_AT . '))');
$stmt = FileSyncPeer::doSelectStmt($criteria);
$mins = $stmt->fetchAll(PDO::FETCH_COLUMN);
if (count($mins)) {
self::$purgeStartUpdatedAt = reset($mins);
}
}
if (is_null(self::$purgeStartUpdatedAt)) {
self::$purgeStartUpdatedAt = 0;
}
self::$purgeNextStartUpdatedAt = self::$purgeStartUpdatedAt;
$oldVersionsUpdatedAtPeriod = 30;
// days
if (isset($options['o'])) {
if (!is_numeric($options['o']) || $options['o'] < 0) {
self::failWrongInputs("Period of old versions to delete must be positive numeric of days");
}
$oldVersionsUpdatedAtPeriod = $options['o'];
}
foreach (self::$oldVersionsStartUpdatedAt as $objectType => $oldVersionsStartUpdatedAt) {
self::$oldVersionsEndUpdatedAt[$objectType] = $oldVersionsStartUpdatedAt + $oldVersionsUpdatedAtPeriod * 60 * 60 * 24;
}
// days
$purgeUpdatedAtPeriod = 30;
// days
if (isset($options['p'])) {
if (!is_numeric($options['p']) || $options['p'] < 0) {
self::failWrongInputs("Period of purge must be positive numeric of days");
}
$purgeUpdatedAtPeriod = $options['p'];
}
self::$purgeEndUpdatedAt = self::$purgeStartUpdatedAt + $purgeUpdatedAtPeriod * 60 * 60 * 24;
// days
$oldPartnersUpdatedAtPeriod = 24;
// months
if (isset($options['b'])) {
if (!is_numeric($options['b']) || $options['b'] < 0) {
self::failWrongInputs("Period of blocked partners to delete must be positive numeric of months");
}
$oldPartnersUpdatedAtPeriod = $options['b'];
}
self::$oldPartnersUpdatedAt = time() - $oldPartnersUpdatedAtPeriod * 60 * 60 * 24 * 30;
// months
$errObjectsUpdatedAtPeriod = 24;
// months
if (isset($options['e'])) {
if (!is_numeric($options['e']) || $options['e'] < 0) {
self::failWrongInputs("Period of error objects to delete must be positive numeric of months");
}
$errObjectsUpdatedAtPeriod = $options['e'];
}
self::$errObjectsUpdatedAt = time() - $errObjectsUpdatedAtPeriod * 60 * 60 * 24 * 30;
// months
if (isset($options['l'])) {
if (!is_numeric($options['l']) || $options['l'] < 0) {
//.........这里部分代码省略.........
示例6: postInsert
/**
* Code to be run after inserting to database
* @param PropelPDO $con
*/
public function postInsert(PropelPDO $con = null)
{
PartnerPeer::setUseCriteriaFilter(false);
$this->reload();
PartnerPeer::setUseCriteriaFilter(true);
kEventsManager::raiseEvent(new kObjectCreatedEvent($this));
if ($this->copiedFrom) {
kEventsManager::raiseEvent(new kObjectCopiedEvent($this->copiedFrom, $this));
}
}
示例7: getLoginPartners
function getLoginPartners()
{
PartnerPeer::clearInstancePool();
$c = new Criteria();
$c1 = $c->getNewCriterion(PartnerPeer::SERVICE_CONFIG_ID, 'services-paramount-mobile.ct');
$c2 = $c->getNewCriterion(PartnerPeer::SERVICE_CONFIG_ID, 'services-disney-mediabowl.ct');
$c1->addOr($c2);
$c->add($c1);
PartnerPeer::setUseCriteriaFilter(false);
$partners = PartnerPeer::doSelect($c);
PartnerPeer::setUseCriteriaFilter(true);
$ids = array();
foreach ($partners as $par) {
$ids[] = $par->getId();
}
return $ids;
}