Atualizar 'src/BBOrm/Entity.php'

This commit is contained in:
ahwelp
2019-02-28 04:04:35 +00:00
parent a3a38c7332
commit e6ea614f74
+14
View File
@@ -8,6 +8,8 @@ abstract class Entity {
protected $connection_name = 'default'; protected $connection_name = 'default';
protected $softdelete = false; protected $softdelete = false;
private $_ignore = Array( private $_ignore = Array(
'classname',
'_properties',
'_ignore', '_ignore',
'connection_name', 'connection_name',
'timestamps', 'timestamps',
@@ -15,6 +17,18 @@ abstract class Entity {
'table_name' '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() { function __construct() {
if (isset($this->timestamps) && $this->timestamps) { if (isset($this->timestamps) && $this->timestamps) {
$this->created_at = date('Y-m-d h:m:s'); $this->created_at = date('Y-m-d h:m:s');