本文整理汇总了PHP中kshowPeer::doSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP kshowPeer::doSelect方法的具体用法?PHP kshowPeer::doSelect怎么用?PHP kshowPeer::doSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kshowPeer
的用法示例。
在下文中一共展示了kshowPeer::doSelect方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getkshows
/**
* Gets an array of kshow objects which contain a foreign key that references this object.
*
* If this collection has already been initialized with an identical Criteria, it returns the collection.
* Otherwise if this kuser has previously been saved, it will retrieve
* related kshows from storage. If this kuser is new, it will return
* an empty collection or the current collection, the criteria is ignored on a new object.
*
* @param PropelPDO $con
* @param Criteria $criteria
* @return array kshow[]
* @throws PropelException
*/
public function getkshows($criteria = null, PropelPDO $con = null)
{
if ($criteria === null) {
$criteria = new Criteria(kuserPeer::DATABASE_NAME);
} elseif ($criteria instanceof Criteria) {
$criteria = clone $criteria;
}
if ($this->collkshows === null) {
if ($this->isNew()) {
$this->collkshows = array();
} else {
$criteria->add(kshowPeer::PRODUCER_ID, $this->id);
kshowPeer::addSelectColumns($criteria);
$this->collkshows = kshowPeer::doSelect($criteria, $con);
}
} else {
// criteria has no effect for a new object
if (!$this->isNew()) {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return the collection.
$criteria->add(kshowPeer::PRODUCER_ID, $this->id);
kshowPeer::addSelectColumns($criteria);
if (!isset($this->lastkshowCriteria) || !$this->lastkshowCriteria->equals($criteria)) {
$this->collkshows = kshowPeer::doSelect($criteria, $con);
}
}
}
$this->lastkshowCriteria = $criteria;
return $this->collkshows;
}
示例2: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
// TODO - verify permissions for viewing lists
$detailed = $this->getP("detailed", false);
$limit = $this->getP("page_size", 10);
$page = $this->getP("page", 1);
//$order_by = int( $this->getP ( "order_by" , -1 ) );
$puser_kuser = null;
$use_filter_puser_id = $this->getP("use_filter_puser_id", 1);
if ($use_filter_puser_id == "false") {
$use_filter_puser_id = false;
}
$offset = ($page - 1) * $limit;
kuserPeer::setUseCriteriaFilter(false);
entryPeer::setUseCriteriaFilter(false);
$c = new Criteria();
// filter
$filter = new kshowFilter();
$fields_set = $filter->fillObjectFromRequest($this->getInputParams(), "filter_", null);
$this->setExtraFilters($filter);
if ($use_filter_puser_id) {
// if so - assume the producer_id is infact a puser_id and the kuser_id should be retrieved
$target_puser_id = $filter->get("_eq_producer_id");
//$this->getP ( "filter__eq_producer_id" );
if ($target_puser_id) {
// TODO - shoud we use the subp_id to retrieve the puser_kuser ?
$puser_kuser = PuserKuserPeer::retrieveByPartnerAndUid($partner_id, null, $target_puser_id, false);
if ($puser_kuser) {
$filter->set("_eq_producer_id", $puser_kuser->getkuserId());
//$this->setP ( "filter__eq_producer_id" , $puser_kuser->getkuserId() );
}
}
}
$filter->attachToCriteria($c);
//if ($order_by != -1) kshowPeer::setOrder( $c , $order_by );
$count = kshowPeer::doCount($c);
$offset = ($page - 1) * $limit;
$c->setLimit($limit);
if ($offset > 0) {
$c->setOffset($offset);
}
if ($detailed) {
$list = kshowPeer::doSelectJoinAll($c);
$level = objectWrapperBase::DETAIL_LEVEL_DETAILED;
// will have to populate the show_entry before according to the ids
fdb::populateObjects($list, new entryPeer(), "showentryid", "showentry", false);
} else {
$list = kshowPeer::doSelect($c);
$level = objectWrapperBase::DETAIL_LEVEL_REGULAR;
// will have to populate the show_entry before according to the ids - we display the thumbnail from the showentry
fdb::populateObjects($list, new entryPeer(), "showentryid", "showentry", false);
}
$this->addMsg("count", $count);
$this->addMsg("page_size", $limit);
$this->addMsg("page", $page);
$wrapper = objectWrapperBase::getWrapperClass($list, $level);
$this->addMsg("kshows", $wrapper);
if ($use_filter_puser_id) {
$this->addMsg("user", objectWrapperBase::getWrapperClass($puser_kuser, objectWrapperBase::DETAIL_LEVEL_REGULAR));
}
/*
$i=0;
foreach ( $list as $kshow )
{
$i++;
$wrapper = objectWrapperBase::getWrapperClass( $kshow , $level );
$this->addMsg ( "kshow$i" , $wrapper ) ;
}
*/
// echo "bbb count: " . count ($list );
// echo "ccc";
//$this->addMsg ( "kshows" , $wrapper ) ;
}
示例3: retrieveByIndexedCustomData3
public static function retrieveByIndexedCustomData3($name)
{
$c = new Criteria();
$c->add(kshowPeer::INDEXED_CUSTOM_DATA_3, $name);
$kshows = kshowPeer::doSelect($c);
if ($kshows != null) {
return $kshows[0];
}
return null;
}
示例4: retrieveByPKs
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param PropelPDO $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, PropelPDO $con = null)
{
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(kshowPeer::DATABASE_NAME);
$criteria->add(kshowPeer::ID, $pks, Criteria::IN);
$objs = kshowPeer::doSelect($criteria, $con);
}
return $objs;
}
示例5: execute
/**
* Will investigate a single entry
*/
public function execute()
{
$this->forceSystemAuthentication();
myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
entryPeer::setUseCriteriaFilter(false);
$this->result = NULL;
$fast = $this->getRequestParameter("fast", "") != "";
$this->fast = $fast;
$kshow_id = $this->getRequestParameter("kshow_id");
$this->kshow_id = $kshow_id;
$this->kshow = NULL;
$entry_id = $this->getRequestParameter("entry_id");
$this->entry_id = $entry_id;
$this->entry = NULL;
$this->error = $this->getRequestParameter("error");
$this->bg_entry = NULL;
if (!empty($kshow_id)) {
$c = new Criteria();
$c->add(kshowPeer::ID, $kshow_id);
$kshows = kshowPeer::doSelect($c);
$kshow = new kshow();
if (!$kshows) {
$this->result = "No kshow [{$kshow_id}] in DB";
return;
}
$kshow_original = $kshows[0];
$kshow_original->getShowEntry();
// pre fetch
$kshow_original->getIntro();
// pre fetch
$this->kshow_original = $kshows[0];
$this->kshow = new genericObjectWrapper($this->kshow_original, true);
$alredy_exist_entries = array();
$alredy_exist_entries[] = $kshow_original->getShowEntryId();
if ($kshow_original->getIntroId()) {
$alredy_exist_entries[] = $kshow_original->getIntroId();
}
$skin_obj = $this->kshow_original->getSkinObj();
$bg_entry_id = $skin_obj->get("bg_entry_id");
if ($bg_entry_id) {
$alredy_exist_entries[] = $bg_entry_id;
$this->bg_entry = new genericObjectWrapper(entryPeer::retrieveByPK($bg_entry_id), true);
}
$c = new Criteria();
$c->add(entryPeer::ID, $alredy_exist_entries, Criteria::NOT_IN);
$c->setLimit(100);
$this->kshow_entries = $this->kshow_original->getEntrysJoinKuser($c);
return;
//return "KshowSuccess";
}
if (empty($entry_id)) {
return;
}
entryPeer::setUseCriteriaFilter(false);
// from entry table
$c = new Criteria();
$c->add(entryPeer::ID, $entry_id);
//$entries = entryPeer::doSelectJoinAll ( $c );
$entries = entryPeer::doSelect($c);
if (!$entries) {
$this->result = "No entry [{$entry_id}] in DB";
return;
}
$this->entry = new genericObjectWrapper($entries[0], true);
// from conversion table
$c = new Criteria();
$c->add(conversionPeer::ENTRY_ID, $entry_id);
$original_conversions = conversionPeer::doSelect($c);
//$this->conversions = array() ; //
$this->conversions = $original_conversions;
//new genericObjectWrapper( $original_conversions );
// find all relevant batches in DB
// from batch_job table
$c = new Criteria();
//$c->add ( BatchJobPeer::DATA , "%\"entryId\";i:" . $entry_id . ";%" , Criteria::LIKE );
$c->add(BatchJobPeer::ENTRY_ID, $entry_id);
$original_batch_jobs = BatchJobPeer::doSelect($c);
$this->batch_jobs = $original_batch_jobs;
// new genericObjectWrapper( $original_batch_jobs );
// use this as a refernece of all the directories
// myBatchFileConverterServer::init( true );
$entry_patttern = "/" . $entry_id . "\\..*/";
$getFileData_method = array('kFile', 'getFileData');
$getFileDataWithContent_method = array('kFile', 'getFileDataWithContent');
// find all relevant files on disk
$c = new Criteria();
$c->add(FileSyncPeer::OBJECT_TYPE, FileSyncObjectType::ENTRY);
$c->add(FileSyncPeer::OBJECT_ID, $entry_id);
// order by OBJECT SUB TYPE
$c->addAscendingOrderByColumn(FileSyncPeer::OBJECT_SUB_TYPE);
$this->file_syncs = FileSyncPeer::doSelect($c);
$file_sync_links = array();
$flavors = assetPeer::retrieveFlavorsByEntryId($entry_id);
$flavor_ids = array();
$this->flavors = array();
foreach ($flavors as $f) {
$flavor_ids[] = $f->getId();
//.........这里部分代码省略.........
示例6: array
// fetch #contribs and #entries per kshow
$kshow_ids = array();
$entry_ids = array();
foreach ($widget_log_list as $widget_log) {
$kshow_id = $widget_log->getKshowId();
if ($kshow_id) {
$kshow_ids[] = $kshow_id;
}
$entry_id = $widget_log->getEntryId();
if ($entry_id) {
$entry_ids[] = $entry_id;
}
}
$c = new Criteria();
$c->add(kshowPeer::ID, $kshow_ids, Criteria::IN);
$kshows = kshowPeer::doSelect($c);
$kshows_data = array();
foreach ($kshows as $kshow) {
$kshows_data[$kshow->getId()] = $kshow;
}
// fetch sum of plays per entry_id
$c = new Criteria();
$c->addSelectColumn(WidgetLogPeer::ENTRY_ID);
$c->addSelectColumn("SUM(" . WidgetLogPeer::PLAYS . ")");
$c->addSelectColumn("SUM(" . WidgetLogPeer::VIEWS . ")");
$c->add(WidgetLogPeer::ENTRY_ID, $entry_ids, Criteria::IN);
$c->addGroupByColumn(WidgetLogPeer::ENTRY_ID);
$rs = WidgetLogPeer::doSelectStmt($c);
$entries_data = array();
$res = $rs->fetchAll();
foreach ($res as $record) {
示例7: execute
/**
*
*/
public function execute()
{
$this->forceSystemAuthentication();
$kshow_ids = $this->getP("kshow_ids");
$partner_id = $this->getP("partner_id");
// $subp_id = $this->getP ( "subp_id") ;
$source_widget_id = $this->getP("source_widget_id", 201);
$submitted = $this->getP("submitted");
$method = $this->getP("method", "partner");
$create = $this->getP("create");
$limit = $this->getP("limit", 20);
if ($limit > 300) {
$limit = 300;
}
$this->kshow_ids = $kshow_ids;
$this->partner_id = $partner_id;
// $this->subp_id = $subp_id;
$this->source_widget_id = $source_widget_id;
$this->method = $method;
$this->create = $create;
$this->limit = $limit;
$errors = array();
$res = array();
$this->errors = $errors;
if ($submitted) {
// fetch all kshows that don't have widgets
$c = new Criteria();
$c->setLimit($limit);
if ($method == "list") {
$c->add(kshowPeer::ID, @explode(",", $kshow_ids), Criteria::IN);
} else {
$c->add(kshowPeer::PARTNER_ID, $partner_id);
if ($create) {
// because we want to create - select those kshows that are not marked as "have widgets"
$c->add(kshowPeer::INDEXED_CUSTOM_DATA_3, NULL, Criteria::EQUAL);
}
}
$c->addAscendingOrderByColumn(kshowPeer::CREATED_AT);
// start at a specific int_id
// TODO
$kshows = kshowPeer::doSelect($c);
$kshow_id_list = $this->getIdList($kshows, $partner_id, $errors);
$fixed_kshows = array();
// $res [] = print_r ( $kshow_id_list ,true );
$this->res = $res;
//return;
$this->errors = $errors;
if ($kshow_id_list) {
// $kshow_id_list_copy = array_ $kshow_id_list ;
$widget_c = new Criteria();
$widget_c->add(widgetPeer::PARTNER_ID, $partner_id);
$widget_c->add(widgetPeer::KSHOW_ID, $kshow_id_list, Criteria::IN);
$widgets = widgetPeer::doSelect($widget_c);
// - IMPORTANT - add the kshow->setIndexedCustomData3 ( $widget_id ) for wikis
foreach ($widgets as $widget) {
$kshow_id = $widget->getKshowId();
if (in_array($kshow_id, $fixed_kshows)) {
continue;
}
// mark the kshow as one that has a widget
$kshow = $this->getKshow($kshows, $kshow_id);
$kshow->setIndexedCustomData3($widget->getId());
$kshow->save();
unset($kshow_id_list[$kshow_id]);
$fixed_kshows[$kshow_id] = $kshow_id;
// print_r ( $kshow_id_list );
}
// create widgets for those who are still on the list === don't have a widget
foreach ($kshow_id_list as $kshow_id) {
if (in_array($kshow_id, $fixed_kshows)) {
continue;
}
$kshow = $this->getKshow($kshows, $kshow_id);
$widget = widget::createWidget($kshow, null, $source_widget_id, null);
$kshow->setIndexedCustomData3($widget->getId());
$kshow->save();
$fixed_kshows[$kshow_id] = $kshow_id;
}
}
// create a log file of the kaltura-widget tagss for wiki
$partner = PartnerPeer::retrieveByPK($partner_id);
if ($partner) {
$secret = $partner->getSecret();
foreach ($kshows as $kshow) {
$kshow_id = $kshow->getId();
$article_name = "Video {$kshow_id}";
$widget_id = $kshow->getIndexedCustomData3();
// by now this kshow should have the widget id
$subp_id = $kshow->getSubpId();
$md5 = md5($kshow_id . $partner_id . $subp_id . $article_name . $widget_id . $secret);
$hash = substr($md5, 1, 10);
$values = array($kshow_id, $partner_id, $subp_id, $article_name, $widget_id, $hash);
$str = implode("|", $values);
$base64_str = base64_encode($str);
$res[] = "kalturaid='{$kshow_id}'\tkwid='{$base64_str}'\t'{$str}'\n";
}
}
//.........这里部分代码省略.........
示例8: getKshowsForKuser
private function getKshowsForKuser($kuser, $kshow)
{
$c = new Criteria();
$c->add(kshowPeer::PRODUCER_ID, $kuser->getId());
if ($kshow) {
$c->add(KshowPeer::ID, $kshow->getId(), Criteria::NOT_EQUAL);
}
$other_kshows_by_producer = kshowPeer::doSelect($c);
return $other_kshows_by_producer;
}