本文整理匯總了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);
}