Atualizar 'src/BBOrm/Entity.php'
This commit is contained in:
@@ -8,6 +8,8 @@ abstract class Entity {
|
||||
protected $connection_name = 'default';
|
||||
protected $softdelete = false;
|
||||
private $_ignore = Array(
|
||||
'classname',
|
||||
'_properties',
|
||||
'_ignore',
|
||||
'connection_name',
|
||||
'timestamps',
|
||||
@@ -15,6 +17,18 @@ abstract class Entity {
|
||||
'table_name'
|
||||
);
|
||||
|
||||
protected $_properties = Array();
|
||||
|
||||
public function get_properties(){
|
||||
$properties = Array();
|
||||
foreach ($this->_properties as $propertie){
|
||||
$obj = new \stdClass();
|
||||
$obj->data = $propertie;
|
||||
$properties[] = $obj;
|
||||
}
|
||||
return json_encode($properties);
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
if (isset($this->timestamps) && $this->timestamps) {
|
||||
$this->created_at = date('Y-m-d h:m:s');
|
||||
|
||||
Reference in New Issue
Block a user