Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
c913f65b91 | |||
244d8cc414 | |||
c8a7781c88 | |||
630c971b45 | |||
1505539e61 | |||
c441d41a02 |
@ -2,7 +2,7 @@
|
|||||||
namespace ProVM\Common\Alias;
|
namespace ProVM\Common\Alias;
|
||||||
|
|
||||||
use \Model as BaseModel;
|
use \Model as BaseModel;
|
||||||
use ProVM\Common\Alias\Model as ModelInterface;
|
use ProVM\Common\Define\Model as ModelInterface;
|
||||||
use ProVM\Common\Factory\Model as ModelFactory;
|
use ProVM\Common\Factory\Model as ModelFactory;
|
||||||
|
|
||||||
abstract class Model extends BaseModel implements ModelInterface {
|
abstract class Model extends BaseModel implements ModelInterface {
|
||||||
|
13
common/Define/Model/Date.php
Normal file
13
common/Define/Model/Date.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
namespace ProVM\Common\Define\Model;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
trait Date {
|
||||||
|
public function date(\DateTime $date = null) {
|
||||||
|
if ($date === null) {
|
||||||
|
return Carbon::parse($this->date);
|
||||||
|
}
|
||||||
|
$this->date = $data->format('Y-m-d');
|
||||||
|
}
|
||||||
|
}
|
13
common/Define/Model/DateTime.php
Normal file
13
common/Define/Model/DateTime.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
namespace ProVM\Common\Define\Model;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
trait DateTime {
|
||||||
|
public function dateTime(\DateTime $date_time = null) {
|
||||||
|
if ($date_time === null) {
|
||||||
|
return Carbon::parse($this->date_time);
|
||||||
|
}
|
||||||
|
$this->date_time = $date_time->format('c');
|
||||||
|
}
|
||||||
|
}
|
13
common/Define/Model/Time.php
Normal file
13
common/Define/Model/Time.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
namespace ProVM\Common\Define\Model;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
trait Time {
|
||||||
|
public function time(\DateTime $time = null) {
|
||||||
|
if ($time === null) {
|
||||||
|
return Carbon::parse($this->time);
|
||||||
|
}
|
||||||
|
$this->time = $time->format('H:i:s e');
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@ namespace ProVM\Common\Factory;
|
|||||||
|
|
||||||
use ORM;
|
use ORM;
|
||||||
use Model as BaseModel;
|
use Model as BaseModel;
|
||||||
use ProVM\Common\Alias\Model as ModelInterface;
|
use ProVM\Common\Define\Model as ModelInterface;
|
||||||
|
|
||||||
class Model {
|
class Model {
|
||||||
public function reset(): Model {
|
public function reset(): Model {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Common\Form;
|
namespace ProVM\Common\Form;
|
||||||
|
|
||||||
use ProVM\Common\Define\Model as BaseModel;
|
use ProVM\Common\Alias\Model as BaseModel;
|
||||||
|
|
||||||
abstract class Model extends BaseModel {}
|
abstract class Model extends BaseModel {}
|
||||||
|
Reference in New Issue
Block a user