本文整理汇总了PHP中Reminder::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Reminder::find方法的具体用法?PHP Reminder::find怎么用?PHP Reminder::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reminder
的用法示例。
在下文中一共展示了Reminder::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveModel
/**
* [saveModel]
* @param boolean $reminder [description]
* @return [type] [description]
*/
protected function saveModel($reminder = false)
{
if (Input::get('id')) {
$reminder = Reminder::find(Input::get('id'));
}
if (!$reminder) {
$reminder = new Reminder();
}
//$load_company_model = $project->company;
$reminder->project_id = Input::get('project_id');
$reminder->user_id = Input::get('user_id');
$reminder->description = Input::get('description');
$reminder->save();
return $reminder;
}
示例2: testAddTable
public function testAddTable()
{
$e = null;
try {
$this->_conn->selectValues("SELECT * FROM reminders");
} catch (Exception $e) {
}
$this->assertInstanceOf('Horde_Db_Exception', $e);
$m = new WeNeedReminders1();
$m->up();
$result = Reminder::create(array('content' => 'hello world', 'remind_at' => '2005-01-01 11:10:01'));
$this->assertInstanceOf('Reminder', $result);
$this->assertEquals('hello world', Reminder::find('first')->content);
$m->down();
$e = null;
try {
$this->_conn->selectValues("SELECT * FROM reminders");
} catch (Exception $e) {
}
$this->assertInstanceOf('Horde_Db_Exception', $e);
}
示例3: testMigratorGoingDownDueToVersionTarget
public function testMigratorGoingDownDueToVersionTarget()
{
$dir = dirname(dirname(dirname(dirname(__FILE__)))) . '/fixtures/migrations/';
Mad_Model_Migration_Migrator::up($dir, 1);
Mad_Model_Migration_Migrator::down($dir, 0);
$user = new User();
$columns = $user->columnNames();
$this->assertFalse(in_array('last_name', $columns));
$e = null;
try {
$this->_conn->selectValues("SELECT * FROM reminders");
} catch (Exception $e) {
}
$this->assertInstanceOf('Horde_Db_Exception', $e);
Mad_Model_Migration_Migrator::up($dir);
$user->resetColumnInformation();
$columns = $user->columnNames();
$this->assertTrue(in_array('last_name', $columns));
$result = Reminder::create(array('content' => 'hello world', 'remind_at' => '2005-01-01 02:22:23'));
$reminder = Reminder::find('first');
$this->assertEquals('hello world', $reminder->content);
}