本文整理汇总了PHP中Condition::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Condition::where方法的具体用法?PHP Condition::where怎么用?PHP Condition::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Condition
的用法示例。
在下文中一共展示了Condition::where方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkCondition
/**
* [checkCondition description]
* @param [type] $cond [description]
* @return [type] [description]
*/
public function checkCondition($cond)
{
$rs = Condition::where('cond_name', '=', $cond)->count();
if (isset($rs)) {
return $rs >= 1 ? false : true;
}
}
示例2: delAction
/**
* [delAction description]
* @param [type] $id [description]
* @return [type] [description]
*/
public function delAction($id)
{
Condition::where('id', '=', $id)->delete();
return Redirect::to('condition')->with('success', 'ชื่อเงื่อนไขรหัส = ' . $id . ' ลบทิ้งสำเร้จ');
}
示例3: _run_sub_query
/**
* @param string $collection
* @param array $condition
* @param string $select
* @return array
*/
private function _run_sub_query($collection, $condition, $select = '_id')
{
if ($this->get_connexion()) {
$SubCond = new Condition();
if (is_array($condition)) {
$SubCond->set_mongoized($condition);
} else {
$SubCond->where($condition);
}
$Query = new Crud\Findr();
$Query->set_connexion($this->get_connexion());
$Query->set_collection($collection);
$Query->set_condition($SubCond);
$Query->disable_callback();
$Query->select($select);
return $Query->all();
} else {
//TODO: Exeption cannot execute subqueries without a Rocketr Connexion
}
}
示例4: addTerm2
public function addTerm2()
{
$con = Condition::where('number', '=', Input::get('number'))->first();
if ($con) {
if ($con->id != Input::get('id')) {
return Redirect::to('admin/addTerm')->withInput()->withErrors(['warning' => 'Number exist in Terms and Conditions, please update or delete the other to proceed.']);
}
}
$con = new Condition();
$con->number = Input::get('number');
$con->title = Input::get('title');
$con->description = Input::get('desc');
$con->save();
return Redirect::action('AdminController@termsncon');
}