photo/application/classes/Model/People.php
2014-08-22 16:54:35 +10:00

18 lines
476 B
PHP

<?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);
}
}
?>