本文整理汇总了PHP中PartnerPeer::doSelectStmt方法的典型用法代码示例。如果您正苦于以下问题:PHP PartnerPeer::doSelectStmt方法的具体用法?PHP PartnerPeer::doSelectStmt怎么用?PHP PartnerPeer::doSelectStmt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartnerPeer
的用法示例。
在下文中一共展示了PartnerPeer::doSelectStmt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listByPartnerAction
/**
* @action listByPartner
* @param KalturaPartnerFilter $filter
* @param KalturaFilterPager $pager
* @return KalturaStorageProfileListResponse
*/
public function listByPartnerAction(KalturaPartnerFilter $filter = null, KalturaFilterPager $pager = null)
{
$c = new Criteria();
if (!is_null($filter)) {
$partnerFilter = new partnerFilter();
$filter->toObject($partnerFilter);
$partnerFilter->set('_gt_id', 0);
$partnerCriteria = new Criteria();
$partnerFilter->attachToCriteria($partnerCriteria);
$partnerCriteria->setLimit(1000);
$partnerCriteria->clearSelectColumns();
$partnerCriteria->addSelectColumn(PartnerPeer::ID);
$stmt = PartnerPeer::doSelectStmt($partnerCriteria);
if ($stmt->rowCount() < 1000) {
$partnerIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
$c->add(StorageProfilePeer::PARTNER_ID, $partnerIds, Criteria::IN);
}
}
if (is_null($pager)) {
$pager = new KalturaFilterPager();
}
$totalCount = StorageProfilePeer::doCount($c);
$pager->attachToCriteria($c);
$list = StorageProfilePeer::doSelect($c);
$newList = KalturaStorageProfileArray::fromStorageProfileArray($list);
$response = new KalturaStorageProfileListResponse();
$response->totalCount = $totalCount;
$response->objects = $newList;
return $response;
}
示例2: validateObjectsAreAllowedPartners
/**
* Validates that all object ids are allowed partner ids
*
* @param string $objectIds comma seperated ids
* @return string comma seperated ids
*/
protected function validateObjectsAreAllowedPartners($objectIds = null)
{
if (!$objectIds) {
return $this->getPartnerId();
}
$c = new Criteria();
$c->addSelectColumn(PartnerPeer::ID);
$subCriterion1 = $c->getNewCriterion(PartnerPeer::PARTNER_PARENT_ID, $this->getPartnerId());
$subCriterion2 = $c->getNewCriterion(PartnerPeer::ID, $this->getPartnerId());
$subCriterion1->addOr($subCriterion2);
$c->add($subCriterion1);
$c->add(PartnerPeer::ID, explode(',', $objectIds), Criteria::IN);
$stmt = PartnerPeer::doSelectStmt($c);
$partnerIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
return implode(',', $partnerIds);
}
示例3: getAllowedPartnerIds
public function getAllowedPartnerIds(partnerFilter $partnerFilter = null)
{
$currentLoginDataId = $this->getLoginDataId();
if (!$currentLoginDataId) {
return array($this->getPartnerId());
}
$c = new Criteria();
$c->addSelectColumn(kuserPeer::PARTNER_ID);
$c->addAnd(kuserPeer::LOGIN_DATA_ID, $currentLoginDataId, Criteria::EQUAL);
$c->addAnd(kuserPeer::STATUS, KuserStatus::ACTIVE, Criteria::EQUAL);
kuserPeer::setUseCriteriaFilter(false);
$stmt = kuserPeer::doSelectStmt($c);
$ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
kuserPeer::setUseCriteriaFilter(true);
// apply filter on partner ids
if ($partnerFilter) {
$c = new Criteria();
$c->addSelectColumn(PartnerPeer::ID);
$partnerFilter->setIdIn($ids);
$partnerFilter->attachToCriteria($c);
$stmt = PartnerPeer::doSelectStmt($c);
$ids = $stmt->fetchAll(PDO::FETCH_COLUMN);
}
return $ids;
}
示例4: doSelectJoinAll
/**
* Selects a collection of Partner objects pre-filled with all related objects.
*
* @param Criteria $criteria
* @param PropelPDO $con
* @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
* @return array Array of Partner objects.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
{
$criteria = clone $criteria;
// Set the correct dbName if it has not been overridden
if ($criteria->getDbName() == Propel::getDefaultDB()) {
$criteria->setDbName(self::DATABASE_NAME);
}
PartnerPeer::addSelectColumns($criteria);
$startcol2 = PartnerPeer::NUM_COLUMNS - PartnerPeer::NUM_LAZY_LOAD_COLUMNS;
kuserPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (kuserPeer::NUM_COLUMNS - kuserPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(PartnerPeer::ANONYMOUS_KUSER_ID, kuserPeer::ID, $join_behavior);
$stmt = PartnerPeer::doSelectStmt($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = PartnerPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = PartnerPeer::getInstanceFromPool($key1))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://propel.phpdb.org/trac/ticket/509
// $obj1->hydrate($row, 0, true); // rehydrate
} else {
$cls = PartnerPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
PartnerPeer::addInstanceToPool($obj1, $key1);
}
// if obj1 already loaded
// Add objects for joined kuser rows
$key2 = kuserPeer::getPrimaryKeyHashFromRow($row, $startcol2);
if ($key2 !== null) {
$obj2 = kuserPeer::getInstanceFromPool($key2);
if (!$obj2) {
$cls = kuserPeer::getOMClass(false);
$obj2 = new $cls();
$obj2->hydrate($row, $startcol2);
kuserPeer::addInstanceToPool($obj2, $key2);
}
// if obj2 loaded
// Add the $obj1 (Partner) to the collection in $obj2 (kuser)
$obj2->addPartner($obj1);
}
// if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
示例5: listByPartnerAction
/**
* @action listByPartner
* @param KalturaPartnerFilter $filter
* @param KalturaFilterPager $pager
* @return KalturaEventNotificationTemplateListResponse
*/
public function listByPartnerAction(KalturaPartnerFilter $filter = null, KalturaFilterPager $pager = null)
{
$c = new Criteria();
if (!is_null($filter)) {
$partnerFilter = new partnerFilter();
$filter->toObject($partnerFilter);
$partnerFilter->set('_gt_id', -1);
$partnerCriteria = new Criteria();
$partnerFilter->attachToCriteria($partnerCriteria);
$partnerCriteria->setLimit(1000);
$partnerCriteria->clearSelectColumns();
$partnerCriteria->addSelectColumn(PartnerPeer::ID);
$stmt = PartnerPeer::doSelectStmt($partnerCriteria);
if ($stmt->rowCount() < 1000) {
$partnerIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
$c->add(EventNotificationTemplatePeer::PARTNER_ID, $partnerIds, Criteria::IN);
}
}
if (is_null($pager)) {
$pager = new KalturaFilterPager();
}
$c->addDescendingOrderByColumn(EventNotificationTemplatePeer::CREATED_AT);
$totalCount = EventNotificationTemplatePeer::doCount($c);
$pager->attachToCriteria($c);
$list = EventNotificationTemplatePeer::doSelect($c);
$newList = KalturaEventNotificationTemplateArray::fromDbArray($list, $this->getResponseProfile());
$response = new KalturaEventNotificationTemplateListResponse();
$response->totalCount = $totalCount;
$response->objects = $newList;
return $response;
}
示例6: 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)
}
示例7: deleteDeletedPartnersFileSyncs
protected static function deleteDeletedPartnersFileSyncs()
{
$partnersCriteria = new Criteria();
$partnersCriteria->add(PartnerPeer::STATUS, array(Partner::PARTNER_STATUS_DELETED, Partner::PARTNER_STATUS_FULL_BLOCK), Criteria::IN);
$partnersCriteria->add(PartnerPeer::UPDATED_AT, self::$oldPartnersUpdatedAt, Criteria::LESS_THAN);
$partnersCriteria->addAscendingOrderByColumn(PartnerPeer::UPDATED_AT);
$partnersCriteria->setLimit(100);
$offset = 0;
$stmt = PartnerPeer::doSelectStmt($partnersCriteria);
$partnerIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
while (count($partnerIds)) {
$criteria = new Criteria();
$criteria->add(FileSyncPeer::STATUS, array(FileSync::FILE_SYNC_STATUS_DELETED, FileSync::FILE_SYNC_STATUS_PENDING), Criteria::NOT_IN);
$criteria->add(FileSyncPeer::PARTNER_ID, $partnerIds, Criteria::IN);
$criteria->addDescendingOrderByColumn(FileSyncPeer::FILE_SIZE);
$criteria->setLimit(self::$queryLimit);
$fileSyncs = FileSyncPeer::doSelect($criteria);
foreach ($fileSyncs as $fileSync) {
self::deleteFileSync($fileSync);
}
kMemoryManager::clearMemory();
$offset += count($partnerIds);
$partnersCriteria->setOffset($offset);
$stmt = PartnerPeer::doSelectStmt($partnersCriteria);
$partnerIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
}
}