本文整理汇总了PHP中fRecordSet类的典型用法代码示例。如果您正苦于以下问题:PHP fRecordSet类的具体用法?PHP fRecordSet怎么用?PHP fRecordSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了fRecordSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findActive
/**
* Returns all active 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 findActive()
{
return fRecordSet::buildFromSQL(
__CLASS__,
array("SELECT checks.* FROM checks JOIN subscriptions ON checks.check_id = subscriptions.check_id WHERE enabled = 1;")
);
}
示例2: 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();
}
示例3: 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');
}
示例4: 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');
}
示例5: 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')
);
}
示例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: 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');
}
示例8: findByBranch
public static function findByBranch($branch, $doctype)
{
//return fRecordSet::buildFromSQL('Production_issue',
// "SELECT production_issues.* FROM production_issues, (SELECT * FROM users WHERE branch_id = '$branch') AS tbl WHERE production_issues.issuer = tbl.username AND production_issues.doc_type = '$doctype' AND YEAR( production_issues.doc_date ) = YEAR( CURDATE( ) ) AND MONTH( production_issues.doc_date ) = MONTH( CURDATE( ))",
// "SELECT count(*) FROM production_issues"
// );
return fRecordSet::buildFromSQL('Production_issue', "SELECT production_issues.* FROM production_issues WHERE production_issues.doc_number LIKE '" . $doctype . "/" . $branch . "/" . "%" . "' AND YEAR( production_issues.doc_date ) = YEAR( CURDATE( ) ) AND MONTH( production_issues.doc_date ) = MONTH( CURDATE( ) )", "SELECT count(*) FROM production_issues");
}
示例9: 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()
);
}
示例10: 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));
}
}
示例11: findActive
static function findActive($check_id = NULL)
{
if (!is_null($check_id) && is_numeric($check_id)) {
$filter = ' AND check_id=' . $check_id;
} else {
$filter = '';
}
return fRecordSet::buildFromSQL(__CLASS__, array('SELECT subscriptions.* FROM subscriptions WHERE user_id = ' . fSession::get('user_id') . $filter));
}
示例12: 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());
}
示例13: findStatus
static function findStatus($po)
{
$records = fRecordSet::build('Good_receipt_note', array('po_no=' => $po));
if ($records->count() > 1) {
return false;
} else {
return true;
}
}
示例14: 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()
);
}
示例15: 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;
}
}