Fixing bugs in Eq2.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
Taylor Otwell
2012-03-16 10:29:43 -05:00
parent e857505e35
commit c9c0ddf569
5 changed files with 36 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
<?php namespace Laravel\Database\Eloquent;
use Laravel\Database;
use Eloquent\Relationships\Has_Many_And_Belongs_To;
use Laravel\Database\Eloquent\Relationships\Has_Many_And_Belongs_To;
abstract class Model {
@@ -320,7 +320,7 @@ abstract class Model {
*/
protected function timestamp()
{
$this->updated_at = $this->get_timestamp();
$this->updated_at = static::get_timestamp();
if ( ! $this->exists) $this->created_at = $this->updated_at;
}
@@ -330,7 +330,7 @@ abstract class Model {
*
* @return mixed
*/
protected function get_timestamp()
protected static function get_timestamp()
{
return date('Y-m-d H:i:s');
}
@@ -406,7 +406,7 @@ abstract class Model {
*/
public function get_attribute($key)
{
return $this->attributes[$key];
return array_get($this->attributes, $key);
}
/**