本文整理汇总了PHP中fRecordSet::build方法的典型用法代码示例。如果您正苦于以下问题:PHP fRecordSet::build方法的具体用法?PHP fRecordSet::build怎么用?PHP fRecordSet::build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fRecordSet
的用法示例。
在下文中一共展示了fRecordSet::build方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show()
{
$this->editable = UserHelper::isEditor();
$cons = array();
$field = trim(fRequest::get('field'));
$start_year = trim(fRequest::get('start_year'));
$major = trim(fRequest::get('major'));
$location = trim(fRequest::get('location'));
$words = trim(fRequest::get('words'));
$cons['login_name|display_name~'] = $words;
if (!empty($field)) {
$cons['field='] = $field;
}
if (!empty($start_year)) {
$cons['start_year='] = $start_year;
}
if (!empty($major)) {
$cons['major='] = $major;
}
if (!empty($location)) {
$cons['location~'] = $location;
}
$this->users = fRecordSet::build('Profile', $cons, array('id' => 'asc'));
$this->field = $field;
$this->start_year = $start_year;
$this->major = $major;
$this->location = $location;
$this->words = $words;
$this->render('search/index');
}
示例2: index
public function index()
{
$this->articles = fRecordSet::build('Article', array('type=' => 'news', 'visible=' => 1), array('priority' => 'desc', 'created_at' => 'desc'), ACTIVITIES_LIMIT - 2);
$this->posts = fRecordSet::build('Article', array('type=' => 'post', 'visible=' => 1, 'priority<' => 999999), array('priority' => 'desc', 'created_at' => 'desc'), ACTIVITIES_LIMIT - 1);
$this->activities = fRecordSet::buildFromSQL('Activity', 'SELECT activities.* FROM activities GROUP BY realname,type,DATE(timestamp),HOUR(timestamp) ORDER BY timestamp DESC LIMIT ' . ACTIVITIES_LIMIT);
$this->render('home/index');
}
示例3: addInterest
public function addInterest($name, $category)
{
global $db;
$db->execute("INSERT INTO interests (category,name) VALUES (%s, %s)", $category, $name);
$record = fRecordSet::build('Interest', array('name=' => $name, 'category=' => $category));
return $record[0]->getInterestId();
}
示例4: showKnown
public function showKnown()
{
if (!UserHelper::isEditor()) {
throw new fValidationException('not allowed');
}
$this->users = fRecordSet::build('Name', array('registered=' => 0), array('student_number' => 'asc'));
$this->render('users/known');
}
示例5: findAll
/**
* Returns all checks on the system
*
* @param string $sort_column The column to sort by
* @param string $sort_dir The direction to sort the column
* @return fRecordSet An object containing all meetups
*/
static function findAll($sort_column = 'name', $sort_dir = 'desc')
{
return fRecordSet::build(
__CLASS__,
array('enabled=' => true,'user_id=|visibility=' => array(fSession::get('user_id'),0)),
array($sort_column => $sort_dir)
);
}
示例6: invalidate
public static function invalidate($username, $problem_id, $submit_time)
{
global $cache;
$affected_reports = fRecordSet::build('Report', array('problem_list~' => $problem_id, 'user_list~' => $username, 'start_datetime<=' => $submit_time, 'end_datetime>=' => $submit_time));
foreach ($affected_reports as $report) {
$cache->delete($report->getBoardCacheKey());
}
}
示例7: findAll
/**
* Returns all meetups on the system
*
* @param string $sort_column The column to sort by
* @param string $sort_dir The direction to sort the column
* @return fRecordSet An object containing all meetups
*/
static function findAll($graph_id=NULL)
{
return fRecordSet::build(
__CLASS__,
array('graph_id=' =>$graph_id),
array()
);
}
示例8: findAll
/**
* Returns all meetups on the system
*
* @param string $sort_column The column to sort by
* @param string $sort_dir The direction to sort the column
* @return fRecordSet An object containing all meetups
*/
static function findAll($dashboard_id=NULL)
{
return fRecordSet::build(
__CLASS__,
array('dashboard_id=' =>$dashboard_id),
array('weight' => 'asc')
);
}
示例9: findByParams
/**
* @param array $where
* @return WpTesting_Model_AbstractTerm
* @throws fNotFoundException
*/
protected function findByParams(array $where = array())
{
$taxonomyTable = fORM::tablize('WpTesting_Model_Taxonomy');
try {
return fRecordSet::build($this->modelName, array($taxonomyTable . '.taxonomy=' => $this->getTaxonomy()) + $where)->getRecord(0);
} catch (fNoRemainingException $e) {
throw new fNotFoundException($this->modelName . ' not found by conditions: ' . var_export($where, true));
}
}
示例10: ackAll
static function ackAll($check_id = NULL)
{
if (!is_null($check_id) && is_numeric($check_id)) {
$filter = array('check_id=' => $check_id);
} else {
$filter = array();
}
return fRecordSet::build(__CLASS__, $filter, array('status' => 'desc'));
}
示例11: findAll
/**
* Returns all meetups on the system
*
* @return fRecordSet An object containing all meetups
*/
static function findAll($group_id = NULL)
{
if (!is_null($group_id) && is_numeric($group_id)) {
$filter = array('group_id=' => $group_id);
} else {
$filter = array();
}
return fRecordSet::build(__CLASS__, $filter, array());
}
示例12: findStatus
static function findStatus($po)
{
$records = fRecordSet::build('Good_receipt_note', array('po_no=' => $po));
if ($records->count() > 1) {
return false;
} else {
return true;
}
}
示例13: findAll
/**
* Returns all meetups on the system
*
* @param string $sort_column The column to sort by
* @param string $sort_dir The direction to sort the column
* @return fRecordSet An object containing all meetups
*/
static function findAll()
{
return fRecordSet::build(
__CLASS__,
array(),
array()
);
}
示例14: findByMonth
/**
* Return entries by month and branch
*
* @param string $branch Branch ID to represent a branch
* @param int $month Specific month as the input
* @param string $item Item code to specify an individual item
* @return int The total movement by month
*/
static function findByMonth($branch, $month, $item)
{
$movements = fRecordSet::build('Inv_movement', array('branch_id=' => $branch, 'date>=' => '2010-' . $month . '-1', 'date<=' => '2010-' . $month . '-31', 'item_id=' => $item));
if ($movements->count()) {
return $movements->getRecord(0)->prepareQuantity();
} else {
return 0;
}
}
示例15: getContactOrEmpty
public function getContactOrEmpty($type)
{
try {
$records = fRecordSet::build('Contact', array('profile_id=' => $this->getId(), 'type=' => $type), array(), 1);
$records->tossIfEmpty();
return $records->getRecord(0)->getContent();
} catch (Exception $e) {
return '';
}
}