本文整理汇总了PHP中kshowPeer::doSelectStmt方法的典型用法代码示例。如果您正苦于以下问题:PHP kshowPeer::doSelectStmt方法的具体用法?PHP kshowPeer::doSelectStmt怎么用?PHP kshowPeer::doSelectStmt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kshowPeer
的用法示例。
在下文中一共展示了kshowPeer::doSelectStmt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSelectJoinAll
/**
* Selects a collection of kshow 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 kshow 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);
}
kshowPeer::addSelectColumns($criteria);
$startcol2 = kshowPeer::NUM_COLUMNS - kshowPeer::NUM_LAZY_LOAD_COLUMNS;
kuserPeer::addSelectColumns($criteria);
$startcol3 = $startcol2 + (kuserPeer::NUM_COLUMNS - kuserPeer::NUM_LAZY_LOAD_COLUMNS);
$criteria->addJoin(kshowPeer::PRODUCER_ID, kuserPeer::ID, $join_behavior);
$stmt = kshowPeer::doSelectStmt($criteria, $con);
$results = array();
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$key1 = kshowPeer::getPrimaryKeyHashFromRow($row, 0);
if (null !== ($obj1 = kshowPeer::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 = kshowPeer::getOMClass(false);
$obj1 = new $cls();
$obj1->hydrate($row);
kshowPeer::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 (kshow) to the collection in $obj2 (kuser)
$obj2->addkshow($obj1);
}
// if joined row not null
$results[] = $obj1;
}
$stmt->closeCursor();
return $results;
}
示例2: array
/**
return array('status' => $status, 'message' => $message, 'objects' => $objects);
objects - array of
'thumb'
'title'
'description'
'id' - unique id to be passed to getMediaInfo
this service will first return the relevant kshows, then find the relevant roughcuts and finally fetch the entries
*/
public function searchMedia($media_type, $searchText, $page, $pageSize, $authData = null, $extraData = null)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
// this bellow will bypass the partner filter - at the end of the code the filter will return to be as was before
$kshow_criteria = kshowPeer::getCriteriaFilter()->getFilter();
$original_kshow_partner_to_filter = $kshow_criteria->get(kshowPeer::PARTNER_ID);
$kshow_criteria->remove(kshowPeer::PARTNER_ID);
$entry_criteria = entryPeer::getCriteriaFilter()->getFilter();
$original_entry_partner_to_filter = $entry_criteria->get(entryPeer::PARTNER_ID);
$entry_criteria->remove(entryPeer::PARTNER_ID);
$page_size = $pageSize > self::MAX_PAGE_SIZE ? self::MAX_PAGE_SIZE : $pageSize;
$status = "ok";
$message = '';
$kshow_filter = $this->getKshowFilter($extraData);
$limit = $pageSize;
$offset = $pageSize * ($page - 1);
// $page starts from 1
// $keywords_array = mySearchUtils::getKeywordsFromStr ( $searchText );
// TODO_ change mechanism !
//$search_mechanism = self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW;
$search_mechanism = self::KALTURA_SERVICE_CRITERIA_FROM_ROUGHCUT;
// TODO - optimize the first part of the entry_id search
// cache once we know the kshow_ids / roughcuts - this will make paginating much faster
$kshow_crit = new Criteria();
$kshow_crit->clearSelectColumns()->clearOrderByColumns();
$kshow_crit->addSelectColumn(kshowPeer::ID);
$kshow_crit->addSelectColumn(kshowPeer::SHOW_ENTRY_ID);
$kshow_crit->setLimit(self::$s_default_count_limit);
$kshow_filter->addSearchMatchToCriteria($kshow_crit, $searchText, kshow::getSearchableColumnName());
if ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW) {
$kshow_crit->add(kshowPeer::ENTRIES, 1, criteria::GREATER_EQUAL);
}
$rs = kshowPeer::doSelectStmt($kshow_crit);
$kshow_arr = array();
$roughcut_arr = array();
$res = $rs->fetchAll();
foreach ($res as $record) {
$kshow_arr[] = $record[0];
$roughcut_arr[] = $record[1];
}
// // old code from doSelectRs
// while($rs->next())
// {
// $kshow_arr[] = $rs->getString(1);
// $roughcut_arr[] = $rs->getString(2);
// }
$crit = new Criteria();
$crit->setOffset($offset);
$crit->setLimit($limit);
$crit->add(entryPeer::TYPE, entryType::MEDIA_CLIP);
$crit->add(entryPeer::MEDIA_TYPE, $media_type);
if ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW) {
$crit->add(entryPeer::KSHOW_ID, $kshow_arr, Criteria::IN);
$entry_results = entryPeer::doSelect($crit);
} elseif ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_ROUGHCUT) {
// $entry_results = roughcutEntryPeer::retrievByRoughcutIds ( $crit , $roughcut_arr , true );
$entry_results = roughcutEntryPeer::retrievEntriesByRoughcutIds($crit, $roughcut_arr);
}
// after the query - return the filter to what it was before
$entry_criteria->addAnd(entryPeer::PARTNER_ID, $original_entry_partner_to_filter);
$kshow_criteria->addAnd(kshowPeer::PARTNER_ID, $original_kshow_partner_to_filter);
$objects = array();
// add thumbs when not image or video
$should_add_thumbs = $media_type != entry::ENTRY_MEDIA_TYPE_AUDIO;
foreach ($entry_results as $obj) {
if ($search_mechanism == self::KALTURA_SERVICE_CRITERIA_FROM_KSHOW) {
$entry = $obj;
} else {
//$entry = $obj->getEntry();
$entry = $obj;
}
/* @var $entry entry */
// use the id as the url - it will help using this entry id in addentry
$object = array("id" => $entry->getId(), "url" => $entry->getDataUrl(), "tags" => $entry->getTags(), "title" => $entry->getName(), "description" => $entry->getTags(), "flash_playback_type" => $entry->getMediaTypeName());
if ($should_add_thumbs) {
$object["thumb"] = $entry->getThumbnailUrl();
}
$objects[] = $object;
}
return array('status' => $status, 'message' => $message, 'objects' => $objects, "needMediaInfo" => self::$NEED_MEDIA_INFO);
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:91,代码来源:myKalturaKshowServices.class.php
示例3: 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(kshowPeer::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.
kshowPeer::setUseCriteriaFilter(false);
$stmt = kshowPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
kshowPeer::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->collentrys = null;
$this->lastentryCriteria = null;
$this->collkvotesRelatedByKshowId = null;
$this->lastkvoteRelatedByKshowIdCriteria = null;
$this->collkvotesRelatedByKuserId = null;
$this->lastkvoteRelatedByKuserIdCriteria = null;
$this->collKshowKusers = null;
$this->lastKshowKuserCriteria = null;
$this->collPuserRoles = null;
$this->lastPuserRoleCriteria = null;
$this->collroughcutEntrys = null;
$this->lastroughcutEntryCriteria = null;
$this->collwidgets = null;
$this->lastwidgetCriteria = null;
}
// if (deep)
}