本文整理汇总了PHP中Event::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::all方法的具体用法?PHP Event::all怎么用?PHP Event::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event::all方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAllRetrieve
public function testAllRetrieve()
{
self::authorizeFromEnv();
$events = Event::all(array('limit' => 3, 'offset' => 0));
if (count($events['data'])) {
$event = Event::retrieve($events['data'][0]->id);
$this->assertSame($events['data'][0]->id, $event->id);
}
}
示例2: index
public function index()
{
if ($this->getDates()) {
$events = Event::where('start', '>=', $_GET['start'])->where('end', '<', $_GET['end'])->get();
echo json_encode($events);
} else {
$events = Event::all();
echo json_encode($events);
}
}
示例3: all
/**
* @before _secure
*/
public function all()
{
$this->noview();
$results = Event::all(array("organization_id = ?" => Registry::get("session")->get("organization")->id));
$events = array();
foreach ($results as $r) {
$events[] = array("title" => $r->title, "start" => $this->returnTime($r->start), "end" => $this->returnTime($r->start), "allDay" => $r->allDay ? true : false, "id" => $r->id, "className" => "event");
}
echo json_encode($events);
}
示例4: view
/**
* view
* Retrieves rows from database.
*/
public function view()
{
$res = new Response();
$res->success = true;
$res->message = "Loaded data";
if (isset($_REQUEST['startDate'])) {
$_SESSION[$GLOBALS['app_id']]['startDate'] = $_REQUEST['startDate'];
$_SESSION[$GLOBALS['app_id']]['endDate'] = $_REQUEST['endDate'];
$res->data = Event::range($_REQUEST['startDate'], $_REQUEST['endDate']);
} else {
$res->data = Event::all();
}
return $res->to_json();
}
示例5: view
/**
* view
* Retrieves rows from database.
*/
public function view()
{
$res = new Response();
$res->success = true;
$res->message = "Loaded data";
//var_dump($this->request);
if (isset($_REQUEST['start'])) {
$this->startDate = $_REQUEST['start'];
$this->endDate = $_REQUEST['end'];
$res->data = Event::range($this->startDate, $this->endDate);
} else {
$res->data = Event::all();
}
return $res->to_json();
}
示例6: __construct
public function __construct()
{
self::authorizeFromEnv();
$this->data = array('parameters' => array("key" => "value"));
$this->datas = array();
// CRUD ___________________________________
// Create
for ($x = 0; $x <= 2; $x++) {
$this->datas[] = Event::create($this->data);
}
$this->created = $this->datas[0];
// Retrieve
$this->retrieved = Event::retrieve($this->created->id);
// Update
// Delete
$this->deleted = $this->created->delete();
// List
$this->order = Event::all(array("order" => "id"));
$this->orderInv = Event::all(array("order" => "-id"));
$this->limit5 = Event::all(array("limit" => "5", "order" => "id"));
$this->limit1 = Event::all(array("start_after" => $this->limit5[1]->id, "end_before" => $this->limit5[3]->id));
$this->oneId = Event::all(array("id" => $this->limit5[1]->id));
}
示例7: index
/**
* Fetches events
*/
function index()
{
$events = Event::all();
header('Content-type:application/json');
print json_encode($events);
}
示例8: getTagsList
public function getTagsList($category)
{
switch ($category) {
case 'Companies':
return Companies::whereNull("Deleted")->orderBy('Company_Full_Name', 'asc')->get(['id_Company as id', 'Company_Full_Name as description'])->toJson();
case 'People':
return People::whereNull("Deleted")->orderBy('First_Name', 'asc')->get(['id_People as id', 'First_Name as description'])->toJson();
case 'Vertical':
return Vertical::all(['id_Vertical as id', 'Main_Description as description'])->toJson();
case 'Products':
return Products::whereNull("Deleted")->orderBy('Product_Title', 'asc')->get(['id_Product as id', 'Product_Title as description'])->toArray();
case 'Events':
return Event::all(['id_Event as id', 'Event_Title as description'])->toJson();
}
}
示例9: index
public static function index()
{
self::check_logged_in();
$events = Event::all();
View::make('Event/index.html', array('events' => $events));
}