| 1 |
<?php |
| 2 |
|
| 3 |
namespace WeDevs\ERP\Framework; |
| 4 |
|
| 5 |
/** |
| 6 |
* Class Model |
| 7 |
* |
| 8 |
* @package WeDevs\ERP\Framework |
| 9 |
*/ |
| 10 |
class Model extends \WeDevs\ORM\Eloquent\Model { |
| 11 |
|
| 12 |
/** |
| 13 |
* Get the table name with WP prefix |
| 14 |
* |
| 15 |
* @return string |
| 16 |
*/ |
| 17 |
public function getTable() { |
| 18 |
return $this->getConnection()->db->prefix . $this->table; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Set the value of the "created at" attribute. |
| 23 |
* |
| 24 |
* @param mixed $value |
| 25 |
* @return void |
| 26 |
*/ |
| 27 |
public function setCreatedAt( $value ) { |
| 28 |
$this->{static::CREATED_AT} = current_time( 'mysql' ); |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Set the value of the "updated at" attribute. |
| 33 |
* |
| 34 |
* @param mixed $value |
| 35 |
* @return void |
| 36 |
*/ |
| 37 |
public function setUpdatedAt( $value ) { |
| 38 |
$this->{static::UPDATED_AT} = current_time( 'mysql' ); |
| 39 |
} |
| 40 |
} |