diff --git a/Account/Account.php b/Account/Account.php index b81f27000..55ddb9944 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -15,6 +15,7 @@ */ namespace phpOMS\Account; +use phpOMS\Contract\ArrayableInterface; use phpOMS\Localization\Localization; use phpOMS\Localization\NullLocalization; use phpOMS\Validation\Base\Email; @@ -30,7 +31,7 @@ use phpOMS\Validation\Base\Email; * @link http://orange-management.com * @since 1.0.0 */ -class Account +class Account implements ArrayableInterface { /** @@ -437,6 +438,9 @@ class Account $this->createdAt = $created; } + /** + * {@inheritdoc} + */ public function toArray() : array { return [ @@ -455,6 +459,14 @@ class Account ]; } + /** + * Get string representation. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public function __toString() { return json_encode($this->toArray()); diff --git a/Account/Group.php b/Account/Group.php index ebb380f52..a9507ca6c 100644 --- a/Account/Group.php +++ b/Account/Group.php @@ -14,6 +14,7 @@ * @link http://orange-management.com */ namespace phpOMS\Account; +use phpOMS\Contract\ArrayableInterface; /** * Account group class. @@ -26,7 +27,7 @@ namespace phpOMS\Account; * @link http://orange-management.com * @since 1.0.0 */ -class Group +class Group implements ArrayableInterface { /** @@ -169,6 +170,9 @@ class Group $this->description = $description; } + /** + * {@inheritdoc} + */ public function toArray() : array { return [ @@ -182,6 +186,14 @@ class Group ]; } + /** + * Get string representation. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public function __toString() { return json_encode($this->toArray()); diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index c6e332756..47377798e 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -1099,11 +1099,29 @@ class DataMapperAbstract implements DataMapperInterface return $query; } + /** + * Get created at column + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public static function getCreatedAt() : string { return static::$createdAt; } + /** + * Get model based on request object + * + * @param RequestAbstract $request Request object + * + * @return mixed + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public static function getByRequest(RequestAbstract $request) { if (!is_null($request->getData('id'))) {