photo/application/classes/Model/People.php

18 lines
476 B
PHP
Raw Normal View History

2014-07-09 03:04:56 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports People.
*
* @package Photo
* @category Models
* @author Deon George
* @copyright (c) 2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Model_People extends ORM {
public function age($x=NULL) {
return sprintf('%02s',date_diff(new DateTime(date('Y-m-d',is_null($x) ? time() : $x)),new DateTime(date('Y-m-d',$this->date_birth)))->y);
}
}
?>