mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
commit
c67ac5befa
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -20,15 +18,13 @@ namespace phpOMS\Account;
|
|||
use phpOMS\Contract\ArrayableInterface;
|
||||
use phpOMS\Localization\Localization;
|
||||
use phpOMS\Localization\NullLocalization;
|
||||
use phpOMS\Validation\Base\Email;
|
||||
use phpOMS\Validation\Network\Email;
|
||||
|
||||
/**
|
||||
* Account manager class.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Account
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -164,7 +160,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @param int $id Account id
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(int $id = 0)
|
||||
{
|
||||
|
|
@ -180,7 +175,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return int Account id
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getId() : int
|
||||
{
|
||||
|
|
@ -193,7 +187,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return Localization
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getL11n() : Localization
|
||||
{
|
||||
|
|
@ -208,7 +201,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setL11n(Localization $l11n) /* : void */
|
||||
{
|
||||
|
|
@ -221,7 +213,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getName() : string
|
||||
{
|
||||
|
|
@ -234,7 +225,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getName1() : string
|
||||
{
|
||||
|
|
@ -247,7 +237,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getName2() : string
|
||||
{
|
||||
|
|
@ -260,7 +249,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getName3() : string
|
||||
{
|
||||
|
|
@ -273,7 +261,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getEmail() : string
|
||||
{
|
||||
|
|
@ -288,7 +275,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getStatus() : int
|
||||
{
|
||||
|
|
@ -303,7 +289,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getType() : int
|
||||
{
|
||||
|
|
@ -316,7 +301,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return \DateTime
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getLastActive() : \DateTime
|
||||
{
|
||||
|
|
@ -329,7 +313,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return \DateTime
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getCreatedAt() : \DateTime
|
||||
{
|
||||
|
|
@ -344,7 +327,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function generatePassword(string $password) /* : void */
|
||||
{
|
||||
|
|
@ -359,7 +341,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setName(string $name) /* : void */
|
||||
{
|
||||
|
|
@ -374,7 +355,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setName1(string $name) /* : void */
|
||||
{
|
||||
|
|
@ -389,7 +369,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setName2(string $name) /* : void */
|
||||
{
|
||||
|
|
@ -404,7 +383,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setName3(string $name) /* : void */
|
||||
{
|
||||
|
|
@ -419,7 +397,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setEmail(string $email) /* : void */
|
||||
{
|
||||
|
|
@ -438,7 +415,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setStatus(int $status) /* : void */
|
||||
{
|
||||
|
|
@ -457,7 +433,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setType(int $type) /* : void */
|
||||
{
|
||||
|
|
@ -474,9 +449,8 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function updateLastActive()
|
||||
public function updateLastActive() /* : void */
|
||||
{
|
||||
$this->lastActive = new \DateTime('NOW');
|
||||
}
|
||||
|
|
@ -508,7 +482,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
|
@ -521,7 +494,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\DataStorage\Session\SessionInterface;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Account
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -74,7 +70,6 @@ class AccountManager implements \Countable
|
|||
* @param SessionInterface $session Session
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(ConnectionAbstract $connection, SessionInterface $session)
|
||||
{
|
||||
|
|
@ -91,7 +86,6 @@ class AccountManager implements \Countable
|
|||
* @return Account
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function get(int $id = 0) : Account
|
||||
{
|
||||
|
|
@ -116,7 +110,6 @@ class AccountManager implements \Countable
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function add(Account $account) : bool
|
||||
{
|
||||
|
|
@ -137,7 +130,6 @@ class AccountManager implements \Countable
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function remove(int $id) : bool
|
||||
{
|
||||
|
|
@ -156,7 +148,6 @@ class AccountManager implements \Countable
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function count() : int
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\Account;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Account status enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Account
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\Account;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Account type enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ use phpOMS\Contract\ArrayableInterface;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Account
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -89,31 +85,13 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
*/
|
||||
protected $permissions = [];
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
*
|
||||
* @var \DateTime
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected $createdAt = null;
|
||||
|
||||
/**
|
||||
* Created by.
|
||||
*
|
||||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected $createdBy = 0;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->createdAt = new \DateTime('now');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -122,7 +100,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getId() : int
|
||||
{
|
||||
|
|
@ -135,7 +112,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getName() : string
|
||||
{
|
||||
|
|
@ -148,7 +124,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @param string $name Group name
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setName(string $name) /* : void */
|
||||
{
|
||||
|
|
@ -161,7 +136,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getDescription() : string
|
||||
{
|
||||
|
|
@ -174,7 +148,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @param string $description Group description
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setDescription(string $description) /* : void */
|
||||
{
|
||||
|
|
@ -187,7 +160,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @return int Group status
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getStatus() : int
|
||||
{
|
||||
|
|
@ -200,7 +172,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @param int $status Group status
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setStatus(int $status) /* : void */
|
||||
{
|
||||
|
|
@ -214,7 +185,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
|
@ -227,7 +197,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
{
|
||||
|
|
@ -243,8 +212,6 @@ class Group implements ArrayableInterface, \JsonSerializable
|
|||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'createdBy' => $this->createdBy,
|
||||
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'),
|
||||
'permissions' => $this->permissions,
|
||||
'members' => $this->members,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\Account;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Accept status enum.
|
||||
*
|
||||
* @category Calendar
|
||||
* @package Modules
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\Account;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Account
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\Algorithm;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Task status enum.
|
||||
*
|
||||
* @category Tasks
|
||||
* @package Modules
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -23,8 +21,6 @@ use phpOMS\Algorithm\AlgorithmType;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Auth
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\Algorithm\Knappsack;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Math
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS;
|
|||
*
|
||||
* @category Framework
|
||||
* @package Framework
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -37,7 +33,7 @@ class ApplicationAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $appName = '';
|
||||
protected $appName = '';
|
||||
|
||||
/**
|
||||
* Config.
|
||||
|
|
@ -45,7 +41,7 @@ class ApplicationAbstract
|
|||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $config = [];
|
||||
protected $config = [];
|
||||
|
||||
/**
|
||||
* Database object.
|
||||
|
|
@ -53,7 +49,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\DataStorage\Database\DatabasePool
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $dbPool = null;
|
||||
protected $dbPool = null;
|
||||
|
||||
/**
|
||||
* Application settings object.
|
||||
|
|
@ -61,7 +57,7 @@ class ApplicationAbstract
|
|||
* @var \Model\CoreSettings
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $appSettings = null;
|
||||
protected $appSettings = null;
|
||||
|
||||
/**
|
||||
* Account manager instance.
|
||||
|
|
@ -69,7 +65,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Account\AccountManager
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $accountManager = null;
|
||||
protected $accountManager = null;
|
||||
|
||||
/**
|
||||
* Cache instance.
|
||||
|
|
@ -77,7 +73,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\DataStorage\Cache\CachePool
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $cachePool = null;
|
||||
protected $cachePool = null;
|
||||
|
||||
/**
|
||||
* ModuleManager instance.
|
||||
|
|
@ -85,7 +81,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Module\ModuleManager
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $moduleManager = null;
|
||||
protected $moduleManager = null;
|
||||
|
||||
/**
|
||||
* Router instance.
|
||||
|
|
@ -93,7 +89,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Router\Router
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $router = null;
|
||||
protected $router = null;
|
||||
|
||||
/**
|
||||
* Dispatcher instance.
|
||||
|
|
@ -101,7 +97,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Dispatcher\Dispatcher
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $dispatcher = null;
|
||||
protected $dispatcher = null;
|
||||
|
||||
/**
|
||||
* Session instance.
|
||||
|
|
@ -109,7 +105,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\DataStorage\Session\SessionInterface
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $sessionManager = null;
|
||||
protected $sessionManager = null;
|
||||
|
||||
/**
|
||||
* Server localization.
|
||||
|
|
@ -117,7 +113,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Localization\Localization
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $l11nServer = null;
|
||||
protected $l11nServer = null;
|
||||
|
||||
/**
|
||||
* Server localization.
|
||||
|
|
@ -125,7 +121,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Log\FileLogger
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $logger = null;
|
||||
protected $logger = null;
|
||||
|
||||
/**
|
||||
* L11n manager.
|
||||
|
|
@ -133,7 +129,7 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Localization\L11nManager
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $l11nManager = null;
|
||||
protected $l11nManager = null;
|
||||
|
||||
/**
|
||||
* Event manager.
|
||||
|
|
@ -141,5 +137,46 @@ class ApplicationAbstract
|
|||
* @var \phpOMS\Event\EventManager
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public $eventManager = null;
|
||||
protected $eventManager = null;
|
||||
|
||||
/**
|
||||
* Set values
|
||||
*
|
||||
* @param string $name Variable name
|
||||
* @param string $value Variable value
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @todo replace with proper setter (faster)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __set($name, $value)
|
||||
{
|
||||
if(!empty($this->$name) || $name === 'config') {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->$name = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get values
|
||||
*
|
||||
* @param string $name Variable name
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @todo replace with proper getter (faster)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __get($name)
|
||||
{
|
||||
if($name === 'config') {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $this->$name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\Asset;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Asset
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -43,7 +39,6 @@ class AssetManager implements \Countable
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -59,7 +54,6 @@ class AssetManager implements \Countable
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function set(string $id, string $asset, bool $overwrite = true) : bool
|
||||
{
|
||||
|
|
@ -80,7 +74,6 @@ class AssetManager implements \Countable
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function remove(string $id) : bool
|
||||
{
|
||||
|
|
@ -101,7 +94,6 @@ class AssetManager implements \Countable
|
|||
* @return mixed Asset
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function get(string $id) /* : ?string */
|
||||
{
|
||||
|
|
@ -118,7 +110,6 @@ class AssetManager implements \Countable
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function count() : int
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\Asset;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Asset types enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Asset
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -28,8 +26,6 @@ use phpOMS\DataStorage\Session\SessionInterface;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Auth
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -59,7 +55,6 @@ class Auth
|
|||
* @param SessionInterface $session Session
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(ConnectionAbstract $connection, SessionInterface $session)
|
||||
{
|
||||
|
|
@ -73,7 +68,6 @@ class Auth
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function authenticate() : int
|
||||
{
|
||||
|
|
@ -94,7 +88,6 @@ class Auth
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function logout(int $uid = null) /* : void */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,7 +15,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\Auth;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Login return types enum.
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Auth
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\System\File
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -38,7 +34,6 @@ class AutoloadException extends \RuntimeException
|
|||
* @param \Exception Previous exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(string $message, int $code = 0, \Exception $previous = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ spl_autoload_register('\phpOMS\Autoloader::default_autoloader');
|
|||
*
|
||||
* @category Framework
|
||||
* @package Framework
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -45,7 +41,6 @@ class Autoloader
|
|||
* @throws AutoloadException Throws this exception if the class to autoload doesn't exist. This could also be related to a wrong namespace/file path correlation.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function default_autoloader(string $class) /* : void */
|
||||
{
|
||||
|
|
@ -70,7 +65,6 @@ class Autoloader
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function exists(string $class) : bool
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,7 +13,7 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance;
|
||||
namespace phpOMS\Business\Finance;
|
||||
|
||||
class Depreciation
|
||||
{
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,17 +13,16 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance;
|
||||
namespace phpOMS\Business\Finance;
|
||||
|
||||
use phpOMS\Math\Statistic\Average;
|
||||
use phpOMS\Math\Matrix\Exception\InvalidDimensionException;
|
||||
|
||||
/**
|
||||
* Finance class.
|
||||
*
|
||||
* @category Log
|
||||
* @package Framework
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -44,7 +41,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getAnnualPercentageYield(float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -62,7 +58,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getStateAnnualInterestRateOfAPY(float $apy, int $n) : float
|
||||
{
|
||||
|
|
@ -79,7 +74,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFutureValueOfAnnuity(float $P, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -96,7 +90,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNumberOfPeriodsOfFVA(float $fva, float $P, float $r) : int
|
||||
{
|
||||
|
|
@ -113,7 +106,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodicPaymentOfFVA(float $fva, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -131,7 +123,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFutureValueOfAnnuityConinuousCompounding(float $cf, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -148,7 +139,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getCashFlowOfFVACC(float $fvacc, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -165,7 +155,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getTimeOfFVACC(float $fvacc, float $cf, float $r) : int
|
||||
{
|
||||
|
|
@ -182,7 +171,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getAnnuityPaymentPV(float $pv, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -199,7 +187,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNumberOfAPPV(float $p, float $pv, float $r) : int
|
||||
{
|
||||
|
|
@ -216,7 +203,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueOfAPPV(float $p, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -233,7 +219,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getAnnuityPaymentFV(float $fv, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -250,7 +235,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNumberOfAPFV(float $p, float $fv, float $r) : int
|
||||
{
|
||||
|
|
@ -267,7 +251,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFutureValueOfAPFV(float $p, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -283,7 +266,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getAnnutiyPaymentFactorPV(float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -299,7 +281,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNumberOfAPFPV(float $p, float $r) : int
|
||||
{
|
||||
|
|
@ -316,7 +297,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueOfAnnuity(float $P, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -333,7 +313,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNumberOfPeriodsOfPVA(float $pva, float $P, float $r) : int
|
||||
{
|
||||
|
|
@ -350,7 +329,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodicPaymentOfPVA(float $pva, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -366,7 +344,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueAnnuityFactor(float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -382,7 +359,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodsOfPVAF(float $p, float $r) : int
|
||||
{
|
||||
|
|
@ -399,7 +375,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueOfAnnuityDue(float $P, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -418,7 +393,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodicPaymentOfPVAD(float $PV, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -435,7 +409,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodsOfPVAD(float $PV, float $P, float $r) : int
|
||||
{
|
||||
|
|
@ -452,7 +425,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFutureValueOfAnnuityDue(float $P, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -469,7 +441,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodicPaymentOfFVAD(float $FV, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -486,7 +457,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodsOfFVAD(float $FV, float $P, float $r) : int
|
||||
{
|
||||
|
|
@ -502,7 +472,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getAssetToSalesRatio(float $assets, float $revenue) : float
|
||||
{
|
||||
|
|
@ -518,7 +487,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getAssetTurnoverRatio(float $assets, float $revenue) : float
|
||||
{
|
||||
|
|
@ -534,7 +502,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getAverageCollectionPeriod(float $receivables, int $period = 365) : float
|
||||
{
|
||||
|
|
@ -550,7 +517,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getReceivablesTurnover(float $sales, float $receivables) : float
|
||||
{
|
||||
|
|
@ -567,7 +533,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getCompoundInterest(float $P, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -584,7 +549,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPrincipalOfCompundInterest(float $C, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -601,7 +565,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodsOfCompundInterest(float $P, float $C, float $r) : float
|
||||
{
|
||||
|
|
@ -618,7 +581,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getContinuousCompounding(float $P, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -635,7 +597,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPrincipalOfContinuousCompounding(float $C, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -652,7 +613,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodsOfContinuousCompounding(float $P, float $C, float $r) : float
|
||||
{
|
||||
|
|
@ -669,7 +629,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getRateOfContinuousCompounding(float $P, float $C, float $t) : float
|
||||
{
|
||||
|
|
@ -685,9 +644,8 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getCurrentRaio(float $assets, float $liabilities) : float
|
||||
public static function getCurrentRatio(float $assets, float $liabilities) : float
|
||||
{
|
||||
return $assets / $liabilities;
|
||||
}
|
||||
|
|
@ -700,7 +658,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDaysInInventory(float $inventory) : float
|
||||
{
|
||||
|
|
@ -716,7 +673,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDebtCoverageRatio(float $income, float $service) : float
|
||||
{
|
||||
|
|
@ -732,7 +688,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDebtRatio(float $liabilities, float $assets) : float
|
||||
{
|
||||
|
|
@ -748,7 +703,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDebtToEquityRatio(float $liabilities, float $equity) : float
|
||||
{
|
||||
|
|
@ -764,7 +718,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDebtToIncomeRatio(float $payments, float $income) : float
|
||||
{
|
||||
|
|
@ -781,7 +734,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDiscountedPaybackPeriod(float $CF, float $O1, float $r) : float
|
||||
{
|
||||
|
|
@ -796,7 +748,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDoublingTime(float $r) : float
|
||||
{
|
||||
|
|
@ -811,7 +762,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDoublingTimeContinuousCompounding(float $r) : float
|
||||
{
|
||||
|
|
@ -828,7 +778,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getEquivalentAnnualAnnuity(float $NPV, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -845,7 +794,6 @@ class FinanceFormulas
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPeriodsOfEAA(float $C, float $NPV, float $r) : int
|
||||
{
|
||||
|
|
@ -862,7 +810,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNetPresentValueOfEAA(float $C, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -881,7 +828,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFreeCashFlowToEquity(float $income, float $depamo, float $capital, float $wc, float $borrowing) : float
|
||||
{
|
||||
|
|
@ -900,7 +846,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFreeCashFlowToFirm(float $ebit, float $t, float $depamo, float $capital, float $wc) : float
|
||||
{
|
||||
|
|
@ -917,7 +862,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFutureValue(float $C, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -934,7 +878,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFutureValueContinuousCompounding(float $PV, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -950,7 +893,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getFutureValueFactor(float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -965,7 +907,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getGeometricMeanReturn(array $r) : float
|
||||
{
|
||||
|
|
@ -983,7 +924,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getGrowingAnnuityFV(float $P, float $r, float $g, int $n) : float
|
||||
{
|
||||
|
|
@ -1001,7 +941,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getGrowingAnnuityPaymentPV(float $PV, float $r, float $g, int $n) : float
|
||||
{
|
||||
|
|
@ -1019,7 +958,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getGrowingAnnuityPaymentFV(float $FV, float $r, float $g, int $n) : float
|
||||
{
|
||||
|
|
@ -1037,7 +975,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getGrowingAnnuityPV(float $P, float $r, float $g, int $n) : float
|
||||
{
|
||||
|
|
@ -1054,7 +991,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getGrowingPerpetuityPV(float $D, float $r, float $g) : float
|
||||
{
|
||||
|
|
@ -1070,7 +1006,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getInterestCoverageRatio(float $ebit, float $expense) : float
|
||||
{
|
||||
|
|
@ -1086,7 +1021,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getInventoryTurnoverRatio(float $sales, float $inventory) : float
|
||||
{
|
||||
|
|
@ -1101,17 +1035,16 @@ class FinanceFormulas
|
|||
*
|
||||
* @return float
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws InvalidDimensionException Throws this exception if the length of the array is 0
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNetPresentValue(array $C, float $r) : float
|
||||
{
|
||||
$count = count($C);
|
||||
|
||||
if ($count === 0) {
|
||||
throw new \Exception('Dimension');
|
||||
throw new InvalidDimensionException($count);
|
||||
}
|
||||
|
||||
$npv = -$C[0];
|
||||
|
|
@ -1132,7 +1065,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNetProfitMargin(float $income, float $sales) : float
|
||||
{
|
||||
|
|
@ -1148,7 +1080,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNetWorkingCapital(float $assets, float $liabilities) : float
|
||||
{
|
||||
|
|
@ -1165,7 +1096,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNumberOfPeriodsPVFV(float $FV, float $PV, float $r) : float
|
||||
{
|
||||
|
|
@ -1181,7 +1111,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPaybackPeriod(float $investment, float $cash) : float
|
||||
{
|
||||
|
|
@ -1197,7 +1126,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueOfPerpetuity(float $D, float $r) : float
|
||||
{
|
||||
|
|
@ -1214,7 +1142,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValue(float $C, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -1231,7 +1158,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueContinuousCompounding(float $C, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -1247,7 +1173,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueFactor(float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -1263,7 +1188,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getQuickRatio(float $assets, float $liabilities) : float
|
||||
{
|
||||
|
|
@ -1279,7 +1203,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getRateOfOnflation(float $oldCPI, float $newCPI) : float
|
||||
{
|
||||
|
|
@ -1295,7 +1218,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getRealRateOfReturn(float $nominal, float $inflation) : float
|
||||
{
|
||||
|
|
@ -1311,7 +1233,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getReceivablesTurnoverRatio(float $sales, float $receivable) : float
|
||||
{
|
||||
|
|
@ -1327,7 +1248,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getRetentionRatio(float $income, float $dividends) : float
|
||||
{
|
||||
|
|
@ -1343,7 +1263,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getReturnOnAssets(float $income, float $assets) : float
|
||||
{
|
||||
|
|
@ -1359,7 +1278,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getReturnOnEquity(float $income, float $equity) : float
|
||||
{
|
||||
|
|
@ -1375,7 +1293,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getReturnOnInvestment(float $earnings, float $investment) : float
|
||||
{
|
||||
|
|
@ -1392,7 +1309,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getSimpleInterest(float $P, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -1408,7 +1324,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getRelativeMarketShareByShare(float $ownShare, float $competitorShare) : float
|
||||
{
|
||||
|
|
@ -1424,7 +1339,6 @@ class FinanceFormulas
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getRelativeMarketShareBySales(float $ownSales, float $competitorSales) : float
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class AR
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class ARCH
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class ARFIMA
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
use phpOMS\Math\Statistic\Average;
|
||||
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class ARMA
|
||||
{
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,7 +13,7 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
use phpOMS\Math\Statistic\Average;
|
||||
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\Math\Statistic\Average;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Math\Finance\Forecasting
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @see https://www.otexts.org/fpp/6/1
|
||||
|
|
@ -91,7 +87,6 @@ class ClassicalDecomposition
|
|||
* @param int $mode Decomposition mode
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(array $data, int $order, int $mode = self::ADDITIVE)
|
||||
{
|
||||
|
|
@ -108,7 +103,6 @@ class ClassicalDecomposition
|
|||
* @return array Returns an array containing the trend cycle component, detrended series, seasonal component and remainder component.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getDecomposition() : array
|
||||
{
|
||||
|
|
@ -134,7 +128,6 @@ class ClassicalDecomposition
|
|||
* @return array Total moving average 2 x m-MA
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function computeTrendCycle(array $data, int $order) : array
|
||||
{
|
||||
|
|
@ -153,7 +146,6 @@ class ClassicalDecomposition
|
|||
* @return array Detrended series / seasonal normalized data
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function computeDetrendedSeries(array $data, array $trendCycleComponent, int $mode) : array
|
||||
{
|
||||
|
|
@ -179,7 +171,6 @@ class ClassicalDecomposition
|
|||
* @return int New data start index
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getStartOfDecomposition(int $dataSize, int $trendCycleComponents) : int
|
||||
{
|
||||
|
|
@ -197,7 +188,6 @@ class ClassicalDecomposition
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function computeSeasonalComponent(array $detrendedSeries, int $order) : array
|
||||
{
|
||||
|
|
@ -228,7 +218,6 @@ class ClassicalDecomposition
|
|||
* @return array All remainders or absolute errors
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function computeRemainderComponent(array $data, array $trendCycleComponent, array $seasonalComponent, int $mode = self::ADDITIVE) : array
|
||||
{
|
||||
|
|
@ -0,0 +1,622 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Business\Finance\Forecasting\ExponentialSmoothing;
|
||||
|
||||
use phpOMS\Business\Finance\Forecasting\SmoothingType;
|
||||
use phpOMS\Math\Statistic\Average;
|
||||
use phpOMS\Math\Statistic\Forecast\Error;
|
||||
|
||||
class ExponentialSmoothing
|
||||
{
|
||||
private $data = [];
|
||||
|
||||
private $errors = [];
|
||||
|
||||
private $rmse = 0.0;
|
||||
|
||||
private $mse = 0.0;
|
||||
|
||||
private $mae = 0.0;
|
||||
|
||||
private $sse = 0.0;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function getRMSE() : float
|
||||
{
|
||||
return $this->rmse;
|
||||
}
|
||||
|
||||
public function getMSE() : float
|
||||
{
|
||||
return $this->mse;
|
||||
}
|
||||
|
||||
public function getMAE() : float
|
||||
{
|
||||
return $this->mae;
|
||||
}
|
||||
|
||||
public function getSSE() : float
|
||||
{
|
||||
return $this->sse;
|
||||
}
|
||||
|
||||
public function getErrors() : array
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
public function getForecast(int $future, int $trendType = TrendType::NONE, int $seasonalType = SeasonalType::NONE, int $cycle = 12, float $damping = 1) : array
|
||||
{
|
||||
$this->rmse = PHP_INT_MAX;
|
||||
|
||||
if($trendType === TrendType::ALL || $seasonalType === SeasonalType::ALL) {
|
||||
$trends = [$trendType];
|
||||
if($trendType === TrendType::ALL) {
|
||||
$trends = [TrendType::NONE, TrendType::ADDITIVE, TrendType::MULTIPLICATIVE];
|
||||
}
|
||||
|
||||
$seasonals = [$seasonalType];
|
||||
if($seasonalType === SeasonalType::ALL) {
|
||||
$seasonals = [SeasonalType::NONE, SeasonalType::ADDITIVE, SeasonalType::MULTIPLICATIVE];
|
||||
}
|
||||
|
||||
$forecast = [];
|
||||
$bestError = PHP_INT_MAX;
|
||||
foreach($trends as $trend) {
|
||||
foreach($seasonals as $seasonal) {
|
||||
$tempForecast = $this->getForecast($future, $trend, $seasonal, $cycle, $damping);
|
||||
|
||||
if ($this->rmse < $bestError) {
|
||||
$bestError = $this->rmse;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $forecast;
|
||||
} elseif($trendType === TrendType::NONE && $seasonalType === SeasonalType::NONE) {
|
||||
return $this->getNoneNone($future);
|
||||
} elseif($trendType === TrendType::NONE && $seasonalType === SeasonalType::ADDITIVE) {
|
||||
return $this->getNoneAdditive($future, $cycle);
|
||||
} elseif($trendType === TrendType::NONE && $seasonalType === SeasonalType::MULTIPLICATIVE) {
|
||||
return $this->getNoneMultiplicative($future, $cycle);
|
||||
} elseif($trendType === TrendType::ADDITIVE && $seasonalType === SeasonalType::NONE) {
|
||||
return $this->getAdditiveNone($future, $damping);
|
||||
} elseif($trendType === TrendType::ADDITIVE && $seasonalType === SeasonalType::ADDITIVE) {
|
||||
return $this->getAdditiveAdditive($future, $cycle, $damping);
|
||||
} elseif($trendType === TrendType::ADDITIVE && $seasonalType === SeasonalType::MULTIPLICATIVE) {
|
||||
return $this->getAdditiveMultiplicative($future, $cycle, $damping);
|
||||
} elseif($trendType === TrendType::MULTIPLICATIVE && $seasonalType === SeasonalType::NONE) {
|
||||
return $this->getMultiplicativeNone($future, $damping);
|
||||
} elseif($trendType === TrendType::MULTIPLICATIVE && $seasonalType === SeasonalType::ADDITIVE) {
|
||||
return $this->getMultiplicativeAdditive($future, $cycle, $damping);
|
||||
} elseif($trendType === TrendType::MULTIPLICATIVE && $seasonalType === SeasonalType::MULTIPLICATIVE) {
|
||||
return $this->getMultiplicativeMultiplicative($future, $cycle, $damping);
|
||||
}
|
||||
|
||||
throw new \Exception();
|
||||
}
|
||||
|
||||
private function dampingSum(float $damping, int $length) : float
|
||||
{
|
||||
if(abs($damping - 1) < 0.001) {
|
||||
return $length;
|
||||
}
|
||||
|
||||
$sum = 0;
|
||||
for($i = 0; $i < $length; $i++) {
|
||||
$sum += pow($damping, $i);
|
||||
}
|
||||
|
||||
return $sum;
|
||||
}
|
||||
|
||||
public function getNoneNone(int $future) : array
|
||||
{
|
||||
$level = [$this->data[0]];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * $level[$i-1];
|
||||
|
||||
$tempForecast[$i] = $level[$i];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getNoneAdditive(int $future, int $cycle) : array
|
||||
{
|
||||
$level = [$this->data[0]];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
$seasonal = [];
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i-1] - $level[0];
|
||||
}
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$gamma = 0.00;
|
||||
|
||||
while($gamma < 1) {
|
||||
$gamma_ = $gamma * (1 - $alpha);
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * $level[$i-1];
|
||||
$seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $level[$i-1]) + (1 - $gamma_) * $seasonal[$i];
|
||||
|
||||
$tempForecast[$i] = $level[$i] + $seasonal[$i+$hm];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$gamma += 0.01;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getNoneMultiplicative(int $future, int $cycle) : array
|
||||
{
|
||||
$level = [$this->data[0]];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
$seasonal = [];
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i] / $level[0];
|
||||
}
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$gamma = 0.00;
|
||||
|
||||
while($gamma < 1) {
|
||||
$gamma_ = $gamma * (1 - $alpha);
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * $level[$i-1];
|
||||
$seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $level[$i-1]) + (1 - $gamma_) * $seasonal[$i];
|
||||
|
||||
$tempForecast[$i] = $level[$i] + $seasonal[$i+$hm];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$gamma += 0.01;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getAdditiveNone(int $future, float $damping) : array
|
||||
{
|
||||
$level = [$this->data[0]];
|
||||
$trend = [$this->data[1] - $this->data[0]];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$beta = 0.00;
|
||||
|
||||
while($beta < 1) {
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]);
|
||||
$trend[$i] = $beta * ($level[$i] - $level[$i-1]) + (1 - $beta) * $damping * $trend[$i-1];
|
||||
|
||||
$tempForecast[$i] = $level[$i] + $this->dampingSum($damping, $i) * $trend[$i];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$beta += 0.01;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getAdditiveAdditive(int $future, int $cycle, float $damping) : array
|
||||
{
|
||||
$level = [1 / $cycle * array_sum(array_slice($this->data, 0, $cycle))];
|
||||
$trend = [1 / $cycle];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
$seasonal = [];
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i-1] - $level[0];
|
||||
}
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$beta = 0.00;
|
||||
|
||||
while($beta < 1) {
|
||||
$gamma = 0.00;
|
||||
|
||||
while($gamma < 1) {
|
||||
$gamma_ = $gamma * (1 - $alpha);
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]);
|
||||
$trend[$i] = $beta * ($level[$i] - $level[$i-1]) + (1 - $beta) * $damping * $trend[$i-1];
|
||||
$seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $level[$i-1]) + (1 - $gamma_) * $seasonal[$i];
|
||||
|
||||
$tempForecast[$i] = $level[$i] + $this->dampingSum($damping, $i) * $trend[$i] + $seasonal[$i+$hm];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$gamma += 0.01;
|
||||
}
|
||||
|
||||
$beta += 0.01;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getAdditiveMultiplicative(int $future, int $cycle, float $damping) : array
|
||||
{
|
||||
$level = [1 / $cycle * array_sum(array_slice($this->data, 0, $cycle))];
|
||||
$trend = [1 / $cycle];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
$seasonal = [];
|
||||
$gamma_ = $gamma * (1 - $alpha);
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i] / $level[0];
|
||||
}
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$beta = 0.00;
|
||||
|
||||
while($beta < 1) {
|
||||
$gamma = 0.00;
|
||||
|
||||
while($gamma < 1) {
|
||||
$gamma_ = $gamma * (1 - $alpha);
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * ($level[$i-1] + $damping * $trend[$i-1]);
|
||||
$trend[$i] = $beta * ($level[$i] - $level[$i-1]) + (1 - $beta) * $damping * $trend[$i-1];
|
||||
$seasonal[$i+$cycle] = $gamma_*($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / ($level[$i-1] + $damping * $trend[$i-1]) + (1 - $gamma_) * $seasonal[$i];
|
||||
|
||||
$tempForecast[] = ($level[$i] + $this->dampingSum($damping, $i) * $trend[$i-1]) * $seasonal[$i+$hm];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$gamma += 0.01;
|
||||
}
|
||||
|
||||
$beta += 0.01;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getMultiplicativeNone(int $future, float $damping) : array
|
||||
{
|
||||
$level = [$this->data[0]];
|
||||
$trend = [$this->data[1] / $this->data[0]];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$beta = 0.00;
|
||||
|
||||
while($beta < 1) {
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$level[$i] = $alpha * ($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping);
|
||||
$trend[$i] = $beta * ($level[$i] / $level[$i-1]) + (1 - $beta) * pow($trend[$i-1], $damping);
|
||||
|
||||
$tempForecast[$i] = $level[$i] * pow($trend[$i], $this->dampingSum($damping, $i));
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$beta += 0.01;
|
||||
}
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getMultiplicativeAdditive(int $future, int $cycle, float $damping) : array
|
||||
{
|
||||
$level = [$this->data[0]];
|
||||
$trend = [1 / $cycle];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
$seasonal = [];
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i-1] - $level[0];
|
||||
}
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$beta = 0.00;
|
||||
|
||||
while($beta < 1) {
|
||||
$gamma = 0.00;
|
||||
|
||||
while($gamma < 1) {
|
||||
$gamma_ = $gamma * (1 - $alpha);
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $seasonal[$i]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping);
|
||||
$trend[$i] = $beta * ($level[$i] / $level[$i-1]) + (1 - $beta) * pow($trend[$i-1], $damping);
|
||||
$seasonal[$i+$cycle] = $gamma_*(($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) - $level[$i-1] * pow($trend[$i-1], $damping)) + (1 - $gamma_) * $seasonal[$i];
|
||||
|
||||
$tempForecast[$i] = $level[$i] * pow($trend[$i], $this->dampingSum($damping, $i)) + $seasonal[$i+$hm];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$gamma += 0.01;
|
||||
}
|
||||
|
||||
$beta += 0.01;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
public function getMultiplicativeMultiplicative(int $future, int $cycle, float $damping) : array
|
||||
{
|
||||
$level = [$this->data[0]];
|
||||
$trend = [1 / $cycle];
|
||||
$dataLength = count($this->data) + $future;
|
||||
$forecast = [];
|
||||
$seasonal = [];
|
||||
|
||||
$sum = 0;
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$sum += ($this->data[$cycle] - $this->data[$i]) / $cycle;
|
||||
}
|
||||
|
||||
$trend[0] *= $sum;
|
||||
|
||||
for($i = 1; $i < $cycle+1; $i++) {
|
||||
$seasonal[$i] = $this->data[$i] / $level[0];
|
||||
}
|
||||
|
||||
$alpha = 0.00;
|
||||
while ($alpha < 1) {
|
||||
$beta = 0.00;
|
||||
|
||||
while($beta < 1) {
|
||||
$gamma = 0.00;
|
||||
|
||||
while($gamma < 1) {
|
||||
$gamma_ = $gamma * (1 - $alpha);
|
||||
$error = [];
|
||||
$tempForecast = [];
|
||||
|
||||
for($i = 1; $i < $dataLength; $i++) {
|
||||
$hm = (int) floor(($i-1) % $cycle) + 1;
|
||||
|
||||
$level[$i] = $alpha * (($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / $seasonal[$i]) + (1 - $alpha) * $level[$i-1] * pow($trend[$i-1], $damping);
|
||||
$trend[$i] = $beta * ($level[$i] / $level[$i-1]) + (1 - $beta) * pow($trend[$i-1], $damping);
|
||||
$seasonal[$i+$cycle] = $gamma_*($i < $dataLength - $future ? $this->data[$i-1] : $tempForecast[$i-1]) / ($level[$i-1] * pow($trend[$i-1], $damping)) + (1 - $gamma_) * $seasonal[$i];
|
||||
|
||||
$tempForecast[$i] = $level[$i] * pow($trend[$i], $this->dampingSum($damping, $i)) * $seasonal[$i+$hm];
|
||||
$error[] = $i < $dataLength - $future ? $this->data[$i] - $tempForecast[$i] : 0;
|
||||
}
|
||||
|
||||
$tempRMSE = Error::getRootMeanSquaredError($error);
|
||||
|
||||
if ($tempRMSE < $this->rmse) {
|
||||
$this->rmse = $tempRMSE;
|
||||
$forecast = $tempForecast;
|
||||
}
|
||||
|
||||
$gamma += 0.01;
|
||||
}
|
||||
|
||||
$beta += 0.01;
|
||||
}
|
||||
|
||||
$alpha += 0.01;
|
||||
}
|
||||
|
||||
$this->errors = $error;
|
||||
$this->mse = Error::getMeanSquaredError($error);
|
||||
$this->mae = Error::getMeanAbsoulteError($error);
|
||||
$this->sse = Error::getSumSquaredError($error);
|
||||
|
||||
return $forecast;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,17 +13,15 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance\Forecasting\ExponentialSmoothing;
|
||||
namespace phpOMS\Business\Finance\Forecasting\ExponentialSmoothing;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Smoothing enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Html
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,17 +13,15 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance\Forecasting\ExponentialSmoothing;
|
||||
namespace phpOMS\Business\Finance\Forecasting\ExponentialSmoothing;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Smoothing enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Html
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class GARCH
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class MA
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class NAR
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class NMA
|
||||
{
|
||||
|
|
@ -6,15 +6,13 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
class SARIMA
|
||||
{
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,17 +13,15 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance\Forecasting;
|
||||
namespace phpOMS\Business\Finance\Forecasting;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Smoothing enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Html
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,15 +13,13 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance;
|
||||
namespace phpOMS\Business\Finance;
|
||||
|
||||
/**
|
||||
* Finance class.
|
||||
*
|
||||
* @category Log
|
||||
* @package Framework
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -41,7 +37,6 @@ class Loan
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPaymentsOnBalloonLoan(float $PV, float $r, int $n, float $balloon = 0) : float
|
||||
{
|
||||
|
|
@ -59,7 +54,6 @@ class Loan
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getBalloonBalanceOfLoan(float $PV, float $P, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -76,7 +70,6 @@ class Loan
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getLoanPayment(float $PV, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -94,7 +87,6 @@ class Loan
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getRemainingBalanceLoan(float $PV, float $P, float $r, int $n) : float
|
||||
{
|
||||
|
|
@ -110,7 +102,6 @@ class Loan
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getLoanToDepositRatio(float $loans, float $deposits) : float
|
||||
{
|
||||
|
|
@ -126,7 +117,6 @@ class Loan
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getLoanToValueRatio(float $loan, float $collateral) : float
|
||||
{
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,22 +13,29 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance;
|
||||
namespace phpOMS\Business\Finance;
|
||||
|
||||
/**
|
||||
* Finance class.
|
||||
*
|
||||
* @category Log
|
||||
* @package Framework
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Lorenzkurve
|
||||
{
|
||||
public static function getGiniCoefficient(array $data)
|
||||
/**
|
||||
* Calculate Gini coefficient
|
||||
*
|
||||
* @param array $data Datapoints (can be unsorted)
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function getGiniCoefficient(array $data) : float
|
||||
{
|
||||
$sum1 = 0;
|
||||
$sum2 = 0;
|
||||
|
|
@ -40,9 +45,9 @@ class Lorenzkurve
|
|||
sort($data);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$sum1 += $i * $value;
|
||||
$sum2 += $value;
|
||||
$i++;
|
||||
$sum1 += $i * $value;
|
||||
$sum2 += $value;
|
||||
$i++;
|
||||
}
|
||||
|
||||
return 2 * $sum1 / ($n * $sum2) - ($n + 1) / $n;
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,15 +13,13 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Finance;
|
||||
namespace phpOMS\Business\Finance;
|
||||
|
||||
/**
|
||||
* Finance class.
|
||||
*
|
||||
* @category Log
|
||||
* @package Framework
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -40,7 +36,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getBondEquivalentYield(float $fv, float $price, int $days) : float
|
||||
{
|
||||
|
|
@ -56,7 +51,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getBookValuePerShare(float $total, int $common) : float
|
||||
{
|
||||
|
|
@ -73,7 +67,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getExpectedReturnCAPM(float $rf, float $beta, float $r) : float
|
||||
{
|
||||
|
|
@ -89,7 +82,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getCapitalGainsYield(float $P0, float $P1) : float
|
||||
{
|
||||
|
|
@ -105,7 +97,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getCurrentYield(float $coupons, float $price) : float
|
||||
{
|
||||
|
|
@ -122,7 +113,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDilutedEarningsPerShare(float $income, float $avg, float $other) : float
|
||||
{
|
||||
|
|
@ -138,7 +128,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDividendPayoutRatio(float $dividends, float $income) : float
|
||||
{
|
||||
|
|
@ -154,7 +143,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDividendYield(float $dividends, float $price) : float
|
||||
{
|
||||
|
|
@ -170,7 +158,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getDividendsPerShare(float $dividends, int $shares) : float
|
||||
{
|
||||
|
|
@ -186,7 +173,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getEarningsPerShare(float $income, float $shares) : float
|
||||
{
|
||||
|
|
@ -202,7 +188,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getEquityMultiplier(float $assets, float $equity) : float
|
||||
{
|
||||
|
|
@ -217,7 +202,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getHoldingPeriodReturn(array $r) : float
|
||||
{
|
||||
|
|
@ -240,7 +224,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getNetAssetValue(float $assets, float $liabilities, int $shares) : float
|
||||
{
|
||||
|
|
@ -256,7 +239,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPriceToBookValue(float $market, float $book) : float
|
||||
{
|
||||
|
|
@ -272,7 +254,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPriceEarningsRatio(float $price, float $earnings) : float
|
||||
{
|
||||
|
|
@ -288,7 +269,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPriceToSalesRatio(float $price, float $sales) : float
|
||||
{
|
||||
|
|
@ -305,7 +285,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getPresentValueOfStockConstantGrowth(float $dividend, float $r, float $g = 0.0) : float
|
||||
{
|
||||
|
|
@ -321,7 +300,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getTaxEquivalentYield(float $free, float $tax) : float
|
||||
{
|
||||
|
|
@ -338,7 +316,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getTotalStockReturn(float $P0, float $P1, float $D) : float
|
||||
{
|
||||
|
|
@ -356,7 +333,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getYieldToMaturity(float $C, float $F, float $P, int $n) : float
|
||||
{
|
||||
|
|
@ -373,7 +349,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getZeroCouponBondValue(float $F, float $r, int $t) : float
|
||||
{
|
||||
|
|
@ -390,7 +365,6 @@ class StockBonds
|
|||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public static function getZeroCouponBondEffectiveYield(float $F, float $PV, int $n) : float
|
||||
{
|
||||
43
Business/Marketing/Metrics.php
Normal file
43
Business/Marketing/Metrics.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Business\Marketing;
|
||||
|
||||
/**
|
||||
* Net Promoter Score
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Metrics {
|
||||
/**
|
||||
* Calculate customer retention
|
||||
*
|
||||
* @param int $ce Customer at the end of the period
|
||||
* @param int $cn New customers during period
|
||||
* @param int $cs Customers at the start of the period
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function getCustomerRetention(int $ce, int $cn, int $cs) : float
|
||||
{
|
||||
return ($ce - $cn) / $cs;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\Business\Marketing;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -41,7 +37,6 @@ class NetPromoterScore {
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
|
|
@ -55,7 +50,6 @@ class NetPromoterScore {
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function add(int $score) /* : void */
|
||||
{
|
||||
|
|
@ -68,7 +62,6 @@ class NetPromoterScore {
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getScore() : int
|
||||
{
|
||||
|
|
@ -91,6 +84,15 @@ class NetPromoterScore {
|
|||
return $total === 0 ? 0 : ((int) ($promoters * 100 / $total)) - ((int) ($detractors * 100 / $total));
|
||||
}
|
||||
|
||||
/**
|
||||
* Count detractors
|
||||
*
|
||||
* Detractors are all ratings below 7.
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function countDetractors() : int
|
||||
{
|
||||
$count = 0;
|
||||
|
|
@ -103,6 +105,15 @@ class NetPromoterScore {
|
|||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count passives
|
||||
*
|
||||
* Passives are all ratings between 7 and 8 (inclusive)
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function countPassives() : int
|
||||
{
|
||||
$count = 0;
|
||||
|
|
@ -115,6 +126,15 @@ class NetPromoterScore {
|
|||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count promoters
|
||||
*
|
||||
* Promotoers are all ratings larger 8
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function countPromoters() : int
|
||||
{
|
||||
$count = 0;
|
||||
|
|
|
|||
43
Business/Programming/Metrics.php
Normal file
43
Business/Programming/Metrics.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Business\Programming;
|
||||
/**
|
||||
* Programming metrics
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Metrics {
|
||||
/**
|
||||
* Calculate ABC metric score
|
||||
*
|
||||
* @latex r = \sqrt{a^{2} + b^{2} + c^{2}}
|
||||
*
|
||||
* @param int $a Assignments
|
||||
* @param int $b Branches
|
||||
* @param int $c Conditionals
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function abcScore(int $a, int $b, int $c) : int
|
||||
{
|
||||
return (int) sqrt($a*$a+$b*$b+$c*$c);
|
||||
}
|
||||
}
|
||||
71
Business/Sales/MarketShareEstimation.php
Normal file
71
Business/Sales/MarketShareEstimation.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
namespace phpOMS\Business\Sales;
|
||||
/**
|
||||
* Market share calculations (Zipf function)
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Business
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class MarketShareEstimation {
|
||||
/**
|
||||
* Calculate rank (r) based on marketshare (m)
|
||||
*
|
||||
* @latex r = \sqrt[s]{\frac{1}{m \times \sum_{n=1}^N{\frac{1}{n^{s}}}}}
|
||||
*
|
||||
* @param int $participants (p)
|
||||
* @param float $marketShare (m)
|
||||
* @param float $modifier (s)
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function getRankFromMarketShare(int $participants, float $marketShare, float $modifier = 1.0) : int
|
||||
{
|
||||
$sum = 0.0;
|
||||
for($i = 0; $i < $participants; $i++) {
|
||||
$sum += 1 / pow($i+1, $modifier);
|
||||
}
|
||||
|
||||
return (int) round(pow(1 / ($marketShare * $sum), 1 / $modifier));
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate marketshare (m) based on rank (r)
|
||||
*
|
||||
* @latex m = \frac{\frac{1}{r^{s}}}{\sum_{n=1}^N{\frac{1}{n^{s}}}}
|
||||
*
|
||||
* @param int $participants (p)
|
||||
* @param int $rank (r)
|
||||
* @param float $modifier (s)
|
||||
*
|
||||
* @return float
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function getMarketShareFromRank(int $participants, int $rank, float $modifier = 1.0) : float
|
||||
{
|
||||
$sum = 0.0;
|
||||
for($i = 0; $i < $participants; $i++) {
|
||||
$sum += 1 / pow($i+1, $modifier);
|
||||
}
|
||||
|
||||
return (1 / pow($rank, $modifier)) / $sum;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\Config;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Config
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -39,7 +35,6 @@ interface OptionsInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function exists($key);
|
||||
|
||||
|
|
@ -53,7 +48,6 @@ interface OptionsInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setOption($key, $value, bool $overwrite = true) : bool;
|
||||
|
||||
|
|
@ -66,7 +60,6 @@ interface OptionsInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setOptions(array $pair, bool $overwrite = true) : bool;
|
||||
|
||||
|
|
@ -78,7 +71,6 @@ interface OptionsInterface
|
|||
* @return mixed Option value
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getOption($key);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -28,8 +26,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Config
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -88,7 +84,6 @@ abstract class SettingsAbstract implements OptionsInterface
|
|||
* @return mixed Option value
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function get($columns)
|
||||
{
|
||||
|
|
@ -117,8 +112,10 @@ abstract class SettingsAbstract implements OptionsInterface
|
|||
|
||||
return $options;
|
||||
} catch (\PDOException $e) {
|
||||
// todo does it mean that the recognition isn't here but at the place where the new happens?
|
||||
throw DatabaseExceptionFactory::create($e);
|
||||
$exception = DatabaseExceptionFactory::createException($e);
|
||||
$message = DatabaseExceptionFactory::createExceptionMessage($e);
|
||||
|
||||
throw new $exception($message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +128,6 @@ abstract class SettingsAbstract implements OptionsInterface
|
|||
* @return mixed Option value
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function set(array $options, bool $store = false) /* : void */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -49,7 +47,6 @@ class CommandManager implements \Countable
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -66,7 +63,6 @@ class CommandManager implements \Countable
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function attach(string $cmd, $callback, $source, bool $overwrite = true) : bool
|
||||
{
|
||||
|
|
@ -89,7 +85,6 @@ class CommandManager implements \Countable
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function detach(string $cmd, $source) : bool
|
||||
{
|
||||
|
|
@ -112,7 +107,6 @@ class CommandManager implements \Countable
|
|||
* @return mixed|bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function trigger(string $cmd, $para)
|
||||
{
|
||||
|
|
@ -129,7 +123,6 @@ class CommandManager implements \Countable
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function count() : int
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ namespace phpOMS\Contract;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Contract
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -39,7 +35,6 @@ interface ArrayableInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function toArray() : array;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -25,8 +23,6 @@ namespace phpOMS\Contract;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Contract
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -40,7 +36,6 @@ interface RenderableInterface
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function render() : string;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\DataStorage\Cache\FileCache;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -39,7 +35,6 @@ class CacheFactory
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
|
|
@ -57,7 +52,6 @@ class CacheFactory
|
|||
* @throws \InvalidArgumentException Throws this exception if the database is not supported.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function create(array $cacheData) : CacheInterface
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -16,15 +14,13 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\DataStorage\Cache;
|
||||
use phpOMS\Datatypes\Exception\InvalidEnumValue;
|
||||
use phpOMS\Stdlib\Base\Exception\InvalidEnumValue;
|
||||
|
||||
/**
|
||||
* Cache interface.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -42,7 +38,6 @@ interface CacheInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function set($key, $value, int $expire = -1) /* : void */;
|
||||
|
||||
|
|
@ -56,7 +51,6 @@ interface CacheInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function add($key, $value, int $expire = -1) : bool;
|
||||
|
||||
|
|
@ -69,7 +63,6 @@ interface CacheInterface
|
|||
* @return mixed Cache value
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function get($key, int $expire = -1);
|
||||
|
||||
|
|
@ -82,7 +75,6 @@ interface CacheInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function delete($key, int $expire = -1) : bool;
|
||||
|
||||
|
|
@ -94,7 +86,6 @@ interface CacheInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function flush(int $expire = 0) : bool;
|
||||
|
||||
|
|
@ -104,7 +95,6 @@ interface CacheInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function flushAll() : bool;
|
||||
|
||||
|
|
@ -118,7 +108,6 @@ interface CacheInterface
|
|||
* @throws InvalidEnumValue
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setStatus(int $status) /* : void */;
|
||||
|
||||
|
|
@ -132,7 +121,6 @@ interface CacheInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function replace($key, $value, int $expire = -1) : bool;
|
||||
|
||||
|
|
@ -142,7 +130,6 @@ interface CacheInterface
|
|||
* @return mixed[] Stats array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function stats() : array;
|
||||
|
||||
|
|
@ -152,7 +139,6 @@ interface CacheInterface
|
|||
* @return int Storage threshold
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getThreshold() : int;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -30,8 +28,6 @@ use phpOMS\DataStorage\Cache\CacheFactory;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -53,7 +49,6 @@ class CachePool implements OptionsInterface
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -68,7 +63,6 @@ class CachePool implements OptionsInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function add(string $key = 'core', CacheInterface $cache) : bool
|
||||
{
|
||||
|
|
@ -89,7 +83,6 @@ class CachePool implements OptionsInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function remove(string $key) : bool
|
||||
{
|
||||
|
|
@ -110,7 +103,6 @@ class CachePool implements OptionsInterface
|
|||
* @return \phpOMS\DataStorage\Cache\CacheInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function get(string $key) /* : ?CacheInterface */
|
||||
{
|
||||
|
|
@ -130,7 +122,6 @@ class CachePool implements OptionsInterface
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function create(string $key, array $config) : bool
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,7 +15,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Cache;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Cache status enum.
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,7 +15,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Cache;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Cache type enum.
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,7 +15,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Cache;
|
||||
|
||||
use phpOMS\Datatypes\Exception\InvalidEnumValue;
|
||||
use phpOMS\Stdlib\Base\Exception\InvalidEnumValue;
|
||||
use phpOMS\System\File\Local\Directory;
|
||||
use phpOMS\System\File\Local\File;
|
||||
|
||||
|
|
@ -28,8 +26,6 @@ use phpOMS\System\File\Local\File;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -83,7 +79,6 @@ class FileCache implements CacheInterface
|
|||
* @param string $path Cache path
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(string $path)
|
||||
{
|
||||
|
|
@ -189,7 +184,6 @@ class FileCache implements CacheInterface
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function build($value, int $expire) : string
|
||||
{
|
||||
|
|
@ -207,7 +201,6 @@ class FileCache implements CacheInterface
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function dataType($value) : int
|
||||
{
|
||||
|
|
@ -241,7 +234,6 @@ class FileCache implements CacheInterface
|
|||
* @throws InvalidEnumValue
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function stringify($value, int $type) : string
|
||||
{
|
||||
|
|
@ -266,7 +258,6 @@ class FileCache implements CacheInterface
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function getExpire(string $raw) : int
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Cache;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -51,7 +47,6 @@ class MemCache implements CacheInterface
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -66,7 +61,6 @@ class MemCache implements CacheInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function addServer($data)
|
||||
{
|
||||
|
|
@ -162,7 +156,6 @@ class MemCache implements CacheInterface
|
|||
* Destructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
|
|
@ -173,7 +166,6 @@ class MemCache implements CacheInterface
|
|||
* Closing cache.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Cache;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ namespace phpOMS\DataStorage\Cache;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ namespace phpOMS\DataStorage\Cache;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Cache
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ use phpOMS\DataStorage\LockException;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\Utils
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -51,7 +47,6 @@ class CookieJar
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -62,7 +57,6 @@ class CookieJar
|
|||
* Lock
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function lock() /* : void */
|
||||
{
|
||||
|
|
@ -75,7 +69,6 @@ class CookieJar
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function isLocked() : bool
|
||||
{
|
||||
|
|
@ -97,7 +90,6 @@ class CookieJar
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function set(string $id, $value, int $expire = 86400, string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, bool $overwrite = true) : bool
|
||||
{
|
||||
|
|
@ -127,7 +119,6 @@ class CookieJar
|
|||
* @throws LockException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function delete(string $id) : bool
|
||||
{
|
||||
|
|
@ -152,7 +143,6 @@ class CookieJar
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function remove(string $id) : bool
|
||||
{
|
||||
|
|
@ -173,7 +163,6 @@ class CookieJar
|
|||
* @throws LockException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function save() /* : void */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -43,7 +39,6 @@ interface DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function create($obj);
|
||||
|
||||
|
|
@ -55,7 +50,6 @@ interface DataMapperInterface
|
|||
* @return int Status
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function update($obj) : int;
|
||||
|
||||
|
|
@ -67,7 +61,6 @@ interface DataMapperInterface
|
|||
* @return int Status
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function delete($obj);
|
||||
|
||||
|
|
@ -79,7 +72,6 @@ interface DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function find(string $search) : array;
|
||||
|
||||
|
|
@ -91,7 +83,6 @@ interface DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function listResults(Builder $query);
|
||||
|
||||
|
|
@ -103,7 +94,6 @@ interface DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populate(array $result);
|
||||
|
||||
|
|
@ -115,7 +105,6 @@ interface DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populateIterable(array $result) : array;
|
||||
|
||||
|
|
@ -127,7 +116,6 @@ interface DataMapperInterface
|
|||
* @return $this
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function with(...$objects);
|
||||
|
||||
|
|
@ -139,7 +127,6 @@ interface DataMapperInterface
|
|||
* @return self
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function get($primaryKey);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -72,7 +68,6 @@ abstract class BuilderAbstract
|
|||
* @return BuilderAbstract
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function prefix(string $prefix) : BuilderAbstract
|
||||
{
|
||||
|
|
@ -87,7 +82,6 @@ abstract class BuilderAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getPrefix() : string
|
||||
{
|
||||
|
|
@ -100,7 +94,6 @@ abstract class BuilderAbstract
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getType() : int
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -29,8 +27,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\Grammar as SchemaGrammar;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -120,7 +116,6 @@ abstract class ConnectionAbstract implements ConnectionInterface
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getPrefix() : string
|
||||
{
|
||||
|
|
@ -157,7 +152,6 @@ abstract class ConnectionAbstract implements ConnectionInterface
|
|||
* Sets the database connection to null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\DataStorage\Database\Connection;
|
||||
|
||||
abstract class ConnectionException extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\DatabaseType;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -37,7 +33,6 @@ class ConnectionFactory
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
|
|
@ -55,7 +50,6 @@ class ConnectionFactory
|
|||
* @throws \InvalidArgumentException Throws this exception if the database is not supported.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function create(array $dbdata) : ConnectionInterface
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\Grammar as SchemaGrammar;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -44,7 +40,6 @@ interface ConnectionInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function connect(array $dbdata) /* : void */;
|
||||
|
||||
|
|
@ -54,7 +49,6 @@ interface ConnectionInterface
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getType() : string;
|
||||
|
||||
|
|
@ -64,7 +58,6 @@ interface ConnectionInterface
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getStatus() : int;
|
||||
|
||||
|
|
@ -74,7 +67,6 @@ interface ConnectionInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function close() /* : void */;
|
||||
|
||||
|
|
@ -84,7 +76,6 @@ interface ConnectionInterface
|
|||
* @return Grammar
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getGrammar() : Grammar;
|
||||
|
||||
|
|
@ -94,7 +85,6 @@ interface ConnectionInterface
|
|||
* @return SchemaGrammar
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getSchemaGrammar() : SchemaGrammar;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -21,6 +19,7 @@ use phpOMS\DataStorage\Database\DatabaseStatus;
|
|||
use phpOMS\DataStorage\Database\DatabaseType;
|
||||
use phpOMS\DataStorage\Database\Query\Grammar\MysqlGrammar;
|
||||
use phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar as MysqlSchemaGrammar;
|
||||
use phpOMS\DataStorage\Database\Exception\InvalidConnectionConfigException;
|
||||
|
||||
/**
|
||||
* Database handler.
|
||||
|
|
@ -30,8 +29,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar as MysqlSchemaGramma
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -47,7 +44,6 @@ class MysqlConnection extends ConnectionAbstract
|
|||
* @param string[] $dbdata the basic database information for establishing a connection
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(array $dbdata)
|
||||
{
|
||||
|
|
@ -65,27 +61,27 @@ class MysqlConnection extends ConnectionAbstract
|
|||
$this->dbdata = isset($dbdata) ? $dbdata : $this->dbdata;
|
||||
|
||||
if(!isset($this->dbdata['db'])) {
|
||||
throw new \Exception('db');
|
||||
throw new InvalidConnectionConfigException('db');
|
||||
}
|
||||
|
||||
if(!isset($this->dbdata['host'])) {
|
||||
throw new \Exception('host');
|
||||
throw new InvalidConnectionConfigException('host');
|
||||
}
|
||||
|
||||
if(!isset($this->dbdata['port'])) {
|
||||
throw new \Exception('port');
|
||||
throw new InvalidConnectionConfigException('port');
|
||||
}
|
||||
|
||||
if(!isset($this->dbdata['database'])) {
|
||||
throw new \Exception('database');
|
||||
throw new InvalidConnectionConfigException('database');
|
||||
}
|
||||
|
||||
if(!isset($this->dbdata['login'])) {
|
||||
throw new \Exception('login');
|
||||
throw new InvalidConnectionConfigException('login');
|
||||
}
|
||||
|
||||
if(!isset($this->dbdata['password'])) {
|
||||
throw new \Exception('password');
|
||||
throw new InvalidConnectionConfigException('password');
|
||||
}
|
||||
|
||||
$this->close();
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -29,8 +27,6 @@ use phpOMS\DataStorage\Database\Query\Grammar\SqliteGrammar;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -46,7 +42,6 @@ class SqliteConnection extends ConnectionAbstract
|
|||
* @param string[] $dbdata the basic database information for establishing a connection
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(array $dbdata)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -30,8 +28,6 @@ use phpOMS\DataStorage\Database\Schema\Grammar\MysqlGrammar as MysqlSchemaGramma
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -46,7 +42,6 @@ class SqlServerConnection extends ConnectionAbstract
|
|||
* @param string[] $dbdata the basic database information for establishing a connection
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(array $dbdata)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\DataStorage\Database\Connector;
|
||||
|
||||
abstract class MysqlConnector extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\DataStorage\Database\Connector;
|
||||
|
||||
abstract class PostgresConnector extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\DataStorage\Database\Connector;
|
||||
|
||||
abstract class SqliteConnector extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\DataStorage\Database\Connector;
|
||||
|
||||
abstract class SqlServerConnector extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -21,6 +19,7 @@ use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
|||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
use phpOMS\DataStorage\DataMapperInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\DataStorage\Database\Exception\InvalidMapperException;
|
||||
|
||||
/**
|
||||
* Datamapper for databases.
|
||||
|
|
@ -29,8 +28,6 @@ use phpOMS\Message\RequestAbstract;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -141,7 +138,20 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
*/
|
||||
protected static $fields = [];
|
||||
|
||||
/**
|
||||
* Initialized objects for cross reference to reduce initialization costs
|
||||
*
|
||||
* @var array[]
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $initObjects = [];
|
||||
|
||||
/**
|
||||
* Highest mapper to know when to clear initialized objects
|
||||
*
|
||||
* @var DataMapperAbstract
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $parentMapper = null;
|
||||
|
||||
/**
|
||||
|
|
@ -164,7 +174,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
|
|
@ -172,9 +181,10 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
|
||||
/**
|
||||
* Clone.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function __clone()
|
||||
{
|
||||
|
|
@ -184,9 +194,10 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* Set database connection.
|
||||
*
|
||||
* @param ConnectionAbstract $con Database connection
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function setConnection(ConnectionAbstract $con) /* : void */
|
||||
{
|
||||
|
|
@ -199,7 +210,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getPrimaryField() : string
|
||||
{
|
||||
|
|
@ -212,7 +222,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getTable() : string
|
||||
{
|
||||
|
|
@ -227,7 +236,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function extend($class) /* : void */
|
||||
{
|
||||
|
|
@ -250,10 +258,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
*
|
||||
* @param array $objects Objects to load
|
||||
*
|
||||
* @return null
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function with(...$objects) /* : void */
|
||||
{
|
||||
|
|
@ -272,7 +279,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function clear() /* : void */
|
||||
{
|
||||
|
|
@ -307,10 +313,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
*
|
||||
* @param string $search Search for
|
||||
*
|
||||
* @return Builder
|
||||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function find(string $search) : array
|
||||
{
|
||||
|
|
@ -336,7 +341,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function create($obj, int $relations = RelationType::ALL)
|
||||
{
|
||||
|
|
@ -368,7 +372,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function createModel($obj, \ReflectionClass $reflectionClass)
|
||||
{
|
||||
|
|
@ -419,6 +422,16 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
return self::$db->con->lastInsertId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id of object
|
||||
*
|
||||
* @param Object $obj Model to create
|
||||
* @param \ReflectionClass $reflectionClass Reflection class
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function getObjectId($obj, \ReflectionClass $reflectionClass = null)
|
||||
{
|
||||
$reflectionClass = $reflectionClass ?? new \ReflectionClass(get_class($obj));
|
||||
|
|
@ -447,7 +460,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function setObjectId(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */
|
||||
{
|
||||
|
|
@ -474,10 +486,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws InvalidMapperException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function createHasMany(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */
|
||||
{
|
||||
|
|
@ -495,7 +506,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
}
|
||||
|
||||
if (!isset(static::$hasMany[$propertyName]['mapper'])) {
|
||||
throw new \Exception('No mapper set for relation object.');
|
||||
throw new InvalidMapperException();
|
||||
}
|
||||
|
||||
/** @var DataMapperAbstract $mapper */
|
||||
|
|
@ -568,7 +579,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function createOwnsOne(string $propertyName, $obj)
|
||||
{
|
||||
|
|
@ -597,7 +607,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function createBelongsTo(string $propertyName, $obj)
|
||||
{
|
||||
|
|
@ -628,7 +637,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function createRelationTable(string $propertyName, array $objsIds, $objId)
|
||||
{
|
||||
|
|
@ -660,7 +668,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function parseValue(string $type, $value)
|
||||
{
|
||||
|
|
@ -698,10 +705,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws InvalidMapperException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function updateHasMany(\ReflectionClass $reflectionClass, $obj, $objId) /* : void */
|
||||
{
|
||||
|
|
@ -719,7 +725,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
}
|
||||
|
||||
if (!isset(static::$hasMany[$propertyName]['mapper'])) {
|
||||
throw new \Exception('No mapper set for relation object.');
|
||||
throw new InvalidMapperException();
|
||||
}
|
||||
|
||||
/** @var DataMapperAbstract $mapper */
|
||||
|
|
@ -786,7 +792,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @throws \Exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function updateRelationTable(string $propertyName, array $objsIds, $objId)
|
||||
{
|
||||
|
|
@ -825,7 +830,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function deleteRelationTable(string $propertyName, array $objsIds, $objId)
|
||||
{
|
||||
|
|
@ -860,7 +864,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function updateOwnsOne(string $propertyName, $obj)
|
||||
{
|
||||
|
|
@ -887,7 +890,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function updateBelongsTo(string $propertyName, $obj)
|
||||
{
|
||||
|
|
@ -911,7 +913,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function updateModel($obj, $objId, \ReflectionClass $reflectionClass = null) /* : void */
|
||||
{
|
||||
|
|
@ -975,7 +976,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function update($obj, int $relations = RelationType::ALL) : int
|
||||
{
|
||||
|
|
@ -1010,10 +1010,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws InvalidMapperException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function deleteHasMany(\ReflectionClass $reflectionClass, $obj, $objId, int $relations) /* : void */
|
||||
{
|
||||
|
|
@ -1031,7 +1030,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
}
|
||||
|
||||
if (!isset(static::$hasMany[$propertyName]['mapper'])) {
|
||||
throw new \Exception('No mapper set for relation object.');
|
||||
throw new InvalidMapperException();
|
||||
}
|
||||
|
||||
/** @var DataMapperAbstract $mapper */
|
||||
|
|
@ -1083,7 +1082,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function deleteOwnsOne(string $propertyName, $obj)
|
||||
{
|
||||
|
|
@ -1109,7 +1107,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function deleteBelongsTo(string $propertyName, $obj)
|
||||
{
|
||||
|
|
@ -1134,7 +1131,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function deleteModel($obj, $objId, int $relations = RelationType::REFERENCE, \ReflectionClass $reflectionClass = null) /* : void */
|
||||
{
|
||||
|
|
@ -1186,10 +1182,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @param mixed $obj Object reference (gets filled with insert id)
|
||||
* @param int $relations Create all relations as well
|
||||
*
|
||||
* @return int
|
||||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function delete($obj, int $relations = RelationType::REFERENCE)
|
||||
{
|
||||
|
|
@ -1218,7 +1213,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populateIterable(array $result) : array
|
||||
{
|
||||
|
|
@ -1244,7 +1238,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populate(array $result, $obj = null)
|
||||
{
|
||||
|
|
@ -1274,7 +1267,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populateManyToMany(array $result, &$obj)
|
||||
{
|
||||
|
|
@ -1316,7 +1308,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @todo accept reflection class as parameter
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populateHasOne(&$obj)
|
||||
{
|
||||
|
|
@ -1359,7 +1350,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @todo accept reflection class as parameter
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populateOwnsOne(&$obj)
|
||||
{
|
||||
|
|
@ -1402,7 +1392,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @todo accept reflection class as parameter
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populateBelongsTo(&$obj)
|
||||
{
|
||||
|
|
@ -1443,10 +1432,9 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws \UnexpectedValueException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function populateAbstract(array $result, $obj)
|
||||
{
|
||||
|
|
@ -1493,7 +1481,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
|
|
@ -1543,9 +1530,8 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getAll(int $relations = RelationType::ALL, string $lang = '')
|
||||
public static function getAll(int $relations = RelationType::ALL, string $lang = '') : array
|
||||
{
|
||||
if(!isset(self::$parentMapper)) {
|
||||
self::setUpParentMapper();
|
||||
|
|
@ -1566,9 +1552,8 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function listResults(Builder $query)
|
||||
public static function listResults(Builder $query) : array
|
||||
{
|
||||
$sth = self::$db->con->prepare($query->toSql());
|
||||
$sth->execute();
|
||||
|
|
@ -1589,9 +1574,8 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getNewest(int $limit = 1, Builder $query = null, int $relations = RelationType::ALL, string $lang = '')
|
||||
public static function getNewest(int $limit = 1, Builder $query = null, int $relations = RelationType::ALL, string $lang = '') : array
|
||||
{
|
||||
self::extend(__CLASS__);
|
||||
|
||||
|
|
@ -1631,7 +1615,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getAllByQuery(Builder $query, int $relations = RelationType::ALL) : array
|
||||
{
|
||||
|
|
@ -1657,7 +1640,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getRandom(int $amount = 1, int $relations = RelationType::ALL)
|
||||
{
|
||||
|
|
@ -1679,12 +1661,11 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @param mixed $obj Objects to fill
|
||||
* @param int $relations Relations type
|
||||
*
|
||||
* @return array
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function fillRelations(array &$obj, int $relations = RelationType::ALL)
|
||||
public static function fillRelations(array &$obj, int $relations = RelationType::ALL) /* : void */
|
||||
{
|
||||
$hasMany = !empty(static::$hasMany);
|
||||
$hasOne = !empty(static::$hasOne);
|
||||
|
|
@ -1721,7 +1702,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getRaw($primaryKey) : array
|
||||
{
|
||||
|
|
@ -1744,7 +1724,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getAllRaw(string $lang = '') : array
|
||||
{
|
||||
|
|
@ -1771,7 +1750,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getHasManyRaw($primaryKey, int $relations = RelationType::ALL) : array
|
||||
{
|
||||
|
|
@ -1825,7 +1803,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getQuery(Builder $query = null) : Builder
|
||||
{
|
||||
|
|
@ -1843,7 +1820,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getCreatedAt() : string
|
||||
{
|
||||
|
|
@ -1860,7 +1836,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getByRequest(RequestAbstract $request)
|
||||
{
|
||||
|
|
@ -1902,7 +1877,18 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
return $result;
|
||||
}
|
||||
|
||||
private static function addInitialized($mapper, $id, $obj = null)
|
||||
/**
|
||||
* Add initialized object to local cache
|
||||
*
|
||||
* @param string $mapper Mapper name
|
||||
* @param mixed $id Object id
|
||||
* @param object $obj Model to cache locally
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function addInitialized(string $mapper, $id, $obj = null) /* : void */
|
||||
{
|
||||
if(!isset(self::$initObjects[$mapper])) {
|
||||
self::$initObjects[$mapper] = [];
|
||||
|
|
@ -1911,13 +1897,55 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
self::$initObjects[$mapper][$id] = $obj;
|
||||
}
|
||||
|
||||
private static function isInitialized($mapper, $id)
|
||||
/**
|
||||
* Check if a object is initialized
|
||||
*
|
||||
* @param string $mapper Mapper name
|
||||
* @param mixed $id Object id
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function isInitialized($mapper, $id) : bool
|
||||
{
|
||||
return isset(self::$initObjects[$mapper]) && isset(self::$initObjects[$mapper][$id]);
|
||||
}
|
||||
|
||||
private static function setUpParentMapper()
|
||||
/**
|
||||
* Define the highest mapper of this request
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function setUpParentMapper() /* : void */
|
||||
{
|
||||
self::$parentMapper = static::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if model exists in database
|
||||
*
|
||||
* @param mixed $id Object id
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function exists($id) : bool
|
||||
{
|
||||
$query = $query ?? new Builder(self::$db);
|
||||
$query->prefix(self::$db->getPrefix())
|
||||
->select(static::$primaryField)
|
||||
->from(static::$table)
|
||||
->where(static::$primaryField, '=', $id);
|
||||
|
||||
$sth = self::$db->con->prepare($query->toSql());
|
||||
$sth->execute();
|
||||
|
||||
$results = $sth->fetchAll(\PDO::FETCH_ASSOC);
|
||||
|
||||
return count($results) === 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,11 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database;
|
||||
|
||||
use phpOMS\DataStorage\Database\Schema\Exception\TableException;
|
||||
|
||||
/**
|
||||
* Database exception factory.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -37,33 +31,36 @@ class DatabaseExceptionFactory
|
|||
*
|
||||
* @param \PDOException $e Exception
|
||||
*
|
||||
* @return \PDOException
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function create(\PDOException $e) : \PDOException
|
||||
public static function createException(\PDOException $e) : string
|
||||
{
|
||||
switch ($e->getCode()) {
|
||||
case '42S02':
|
||||
return self::createTableViewException($e);
|
||||
return '\phpOMS\DataStorage\Database\Schema\Exception\TableException';
|
||||
default:
|
||||
return $e;
|
||||
return '\PDOException';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create table exception.
|
||||
* Constructor.
|
||||
*
|
||||
* @param \PDOException $e Exception
|
||||
*
|
||||
* @return \PDOException
|
||||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private static function createTableViewException(\PDOException $e) : \PDOException
|
||||
public static function createExceptionMessage(\PDOException $e) : string
|
||||
{
|
||||
return new TableException(TableException::findTable($e->getMessage()));
|
||||
switch ($e->getCode()) {
|
||||
case '42S02':
|
||||
return TableException::findTable($e->getMessage());
|
||||
default:
|
||||
return $e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -46,7 +42,6 @@ class DatabasePool
|
|||
* Constructor.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -61,7 +56,6 @@ class DatabasePool
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function add(string $key = 'core', ConnectionAbstract $db) : bool
|
||||
{
|
||||
|
|
@ -82,7 +76,6 @@ class DatabasePool
|
|||
* @return ConnectionAbstract|null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function get(string $key = 'core') /* : ?ConnectionAbstract */
|
||||
{
|
||||
|
|
@ -101,7 +94,6 @@ class DatabasePool
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function remove(string $key) : bool
|
||||
{
|
||||
|
|
@ -123,7 +115,6 @@ class DatabasePool
|
|||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function create($key, array $config) : bool
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,7 +15,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Database status enum.
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,7 +15,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Database type enum.
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -15,34 +13,30 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Math\Matrix;
|
||||
namespace phpOMS\DataStorage\Database\Exception;
|
||||
|
||||
/**
|
||||
* Permission exception class.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\System\File
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class DimensionException extends \RuntimeException
|
||||
class InvalidConnectionConfigException extends \RuntimeException
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param int $m Dimension M
|
||||
* @param int $n Dimension N
|
||||
* @param string $message Exception message
|
||||
* @param int $code Exception code
|
||||
* @param \Exception Previous exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct($m, $n, int $code = 0, \Exception $previous = null)
|
||||
public function __construct(string $message = '', int $code = 0, \Exception $previous = null)
|
||||
{
|
||||
parent::__construct('Dimension of "' . $n . '-' . $m . '" invalid.', $code, $previous);
|
||||
parent::__construct('Missing config value for "'. $message .'".', $code, $previous);
|
||||
}
|
||||
}
|
||||
46
DataStorage/Database/Exception/InvalidMapperException.php
Normal file
46
DataStorage/Database/Exception/InvalidMapperException.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.1
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\DataStorage\Database\Exception;
|
||||
|
||||
/**
|
||||
* Permission exception class.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\System\File
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class InvalidMapperException extends \RuntimeException
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $message Exception message
|
||||
* @param int $code Exception code
|
||||
* @param \Exception Previous exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(string $message = '', int $code = 0, \Exception $previous = null)
|
||||
{
|
||||
if($message === '') {
|
||||
parent::__construct('Empty mapper.', $code, $previous);
|
||||
} else {
|
||||
parent::__construct('Mapper "' . $message . '" is invalid.', $code, $previous);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ use phpOMS\Utils\StringUtils;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -98,7 +94,6 @@ abstract class GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function compileQuery(BuilderAbstract $query) : string
|
||||
{
|
||||
|
|
@ -122,7 +117,6 @@ abstract class GrammarAbstract
|
|||
* @return array Parsed query components
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
abstract protected function compileComponents(BuilderAbstract $query) : array;
|
||||
|
||||
|
|
@ -132,7 +126,6 @@ abstract class GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getDateFormat() : string
|
||||
{
|
||||
|
|
@ -145,7 +138,6 @@ abstract class GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getTablePrefix() : string
|
||||
{
|
||||
|
|
@ -158,7 +150,6 @@ abstract class GrammarAbstract
|
|||
* @param string $prefix Table prefix
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setTablePrefix(string $prefix) /* : void */
|
||||
{
|
||||
|
|
@ -174,7 +165,6 @@ abstract class GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function expressionizeTableColumn(array $elements, string $prefix = '') : string
|
||||
{
|
||||
|
|
@ -208,7 +198,6 @@ abstract class GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileSystem($system, string $prefix = '') : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -25,8 +23,6 @@ use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -217,7 +213,6 @@ class Builder extends BuilderAbstract
|
|||
* @param ConnectionAbstract $connection Database connection
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(ConnectionAbstract $connection, bool $readOnly = false)
|
||||
{
|
||||
|
|
@ -233,7 +228,6 @@ class Builder extends BuilderAbstract
|
|||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function setConnection(ConnectionAbstract $connection) /* : void */
|
||||
{
|
||||
|
|
@ -251,7 +245,6 @@ class Builder extends BuilderAbstract
|
|||
* @todo Closure is not working this way, needs to be evaluated befor assigning
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function select(...$columns) : Builder
|
||||
{
|
||||
|
|
@ -278,7 +271,6 @@ class Builder extends BuilderAbstract
|
|||
* @todo Closure is not working this way, needs to be evaluated befor assigning
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function random(...$columns) : Builder
|
||||
{
|
||||
|
|
@ -297,7 +289,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function bind($binds) : Builder
|
||||
{
|
||||
|
|
@ -318,7 +309,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function newQuery() : Builder
|
||||
{
|
||||
|
|
@ -331,7 +321,6 @@ class Builder extends BuilderAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function toSql() : string
|
||||
{
|
||||
|
|
@ -346,7 +335,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function raw(string $raw) : Builder
|
||||
{
|
||||
|
|
@ -377,7 +365,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function selectRaw($expression) : Builder
|
||||
{
|
||||
|
|
@ -392,7 +379,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function distinct(...$columns) : Builder
|
||||
{
|
||||
|
|
@ -409,7 +395,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function from(...$tables) : Builder
|
||||
{
|
||||
|
|
@ -432,7 +417,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function fromRaw($expression) : Builder
|
||||
{
|
||||
|
|
@ -454,7 +438,6 @@ class Builder extends BuilderAbstract
|
|||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function where($columns, $operator = null, $values = null, $boolean = 'and') : Builder
|
||||
{
|
||||
|
|
@ -504,7 +487,6 @@ class Builder extends BuilderAbstract
|
|||
* @return array|null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getWhereByColumn($column) /* : ?array */
|
||||
{
|
||||
|
|
@ -520,7 +502,6 @@ class Builder extends BuilderAbstract
|
|||
* @return string|null
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getTableOfSystem($expression, string $systemIdentifier) /* : ?string */
|
||||
{
|
||||
|
|
@ -539,7 +520,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function andWhere(Where $where) : Builder
|
||||
{
|
||||
|
|
@ -559,7 +539,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function orWhere(Where $where) : Builder
|
||||
{
|
||||
|
|
@ -581,7 +560,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function whereIn($column, $values = null, string $boolean = 'and') : Builder
|
||||
{
|
||||
|
|
@ -599,7 +577,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function whereNull($column, string $boolean = 'and') : Builder
|
||||
{
|
||||
|
|
@ -617,7 +594,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function whereNotNull($column, string $boolean = 'and') : Builder
|
||||
{
|
||||
|
|
@ -634,7 +610,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function groupBy(...$columns) : Builder
|
||||
{
|
||||
|
|
@ -657,7 +632,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function newest($column) : Builder
|
||||
{
|
||||
|
|
@ -674,7 +648,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function oldest($column) : Builder
|
||||
{
|
||||
|
|
@ -692,7 +665,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function orderBy($columns, $order = 'DESC') : Builder
|
||||
{
|
||||
|
|
@ -717,7 +689,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function offset($offset) : Builder
|
||||
{
|
||||
|
|
@ -734,7 +705,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function limit($limit) : Builder
|
||||
{
|
||||
|
|
@ -751,7 +721,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function union($query) : Builder
|
||||
{
|
||||
|
|
@ -768,7 +737,6 @@ class Builder extends BuilderAbstract
|
|||
* Lock query.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function lock()
|
||||
{
|
||||
|
|
@ -778,7 +746,6 @@ class Builder extends BuilderAbstract
|
|||
* Lock for update query.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function lockUpdate()
|
||||
{
|
||||
|
|
@ -788,7 +755,6 @@ class Builder extends BuilderAbstract
|
|||
* Create query string.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
|
@ -799,7 +765,6 @@ class Builder extends BuilderAbstract
|
|||
* Find query.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function find()
|
||||
{
|
||||
|
|
@ -809,7 +774,6 @@ class Builder extends BuilderAbstract
|
|||
* Count results.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function count(string $table = '*')
|
||||
{
|
||||
|
|
@ -821,7 +785,6 @@ class Builder extends BuilderAbstract
|
|||
* Check if exists.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function exists()
|
||||
{
|
||||
|
|
@ -831,7 +794,6 @@ class Builder extends BuilderAbstract
|
|||
* Select minimum.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function min()
|
||||
{
|
||||
|
|
@ -841,7 +803,6 @@ class Builder extends BuilderAbstract
|
|||
* Select maximum.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function max()
|
||||
{
|
||||
|
|
@ -851,7 +812,6 @@ class Builder extends BuilderAbstract
|
|||
* Select sum.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function sum()
|
||||
{
|
||||
|
|
@ -861,7 +821,6 @@ class Builder extends BuilderAbstract
|
|||
* Select average.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function avg()
|
||||
{
|
||||
|
|
@ -875,7 +834,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function insert(...$columns) : Builder
|
||||
{
|
||||
|
|
@ -900,7 +858,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function into($table) : Builder
|
||||
{
|
||||
|
|
@ -917,7 +874,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function values(...$values) : Builder
|
||||
{
|
||||
|
|
@ -935,7 +891,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function value($value, string $type = 'string') : Builder
|
||||
{
|
||||
|
|
@ -955,7 +910,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function update(...$columns) : Builder
|
||||
{
|
||||
|
|
@ -976,7 +930,6 @@ class Builder extends BuilderAbstract
|
|||
* Increment value.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function increment()
|
||||
{
|
||||
|
|
@ -986,7 +939,6 @@ class Builder extends BuilderAbstract
|
|||
* Decrement value.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function decrement()
|
||||
{
|
||||
|
|
@ -996,7 +948,6 @@ class Builder extends BuilderAbstract
|
|||
* Join.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function join($table1, $table2, $column1, $opperator, $column2)
|
||||
{
|
||||
|
|
@ -1007,7 +958,6 @@ class Builder extends BuilderAbstract
|
|||
* Join where.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function joinWhere()
|
||||
{
|
||||
|
|
@ -1017,7 +967,6 @@ class Builder extends BuilderAbstract
|
|||
* Left join.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function leftJoin()
|
||||
{
|
||||
|
|
@ -1027,7 +976,6 @@ class Builder extends BuilderAbstract
|
|||
* Left join where.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function leftJoinWhere()
|
||||
{
|
||||
|
|
@ -1037,7 +985,6 @@ class Builder extends BuilderAbstract
|
|||
* Right join.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function rightJoin()
|
||||
{
|
||||
|
|
@ -1047,7 +994,6 @@ class Builder extends BuilderAbstract
|
|||
* Right join where.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function rightJoinWhere()
|
||||
{
|
||||
|
|
@ -1059,7 +1005,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function rollback()
|
||||
{
|
||||
|
|
@ -1070,7 +1015,6 @@ class Builder extends BuilderAbstract
|
|||
* On.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function on()
|
||||
{
|
||||
|
|
@ -1087,7 +1031,6 @@ class Builder extends BuilderAbstract
|
|||
* @return Builder
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function merge(Builder $query) : Builder
|
||||
{
|
||||
|
|
@ -1100,7 +1043,6 @@ class Builder extends BuilderAbstract
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
|
|
@ -1123,7 +1065,6 @@ class Builder extends BuilderAbstract
|
|||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function getBindParamType($value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Database\Query;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -45,7 +41,6 @@ class Column
|
|||
* @param string $column Column
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(string $column)
|
||||
{
|
||||
|
|
@ -58,7 +53,6 @@ class Column
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function getColumn() : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -29,8 +27,6 @@ use phpOMS\DataStorage\Database\Query\Where;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -102,7 +98,6 @@ class Grammar extends GrammarAbstract
|
|||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileComponents(BuilderAbstract $query) : array
|
||||
{
|
||||
|
|
@ -150,7 +145,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileSelects(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
@ -172,7 +166,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileFrom(Builder $query, array $table) : string
|
||||
{
|
||||
|
|
@ -195,7 +188,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileWheres(Builder $query, array $wheres, bool $first = true) : string
|
||||
{
|
||||
|
|
@ -225,7 +217,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileWhereElement(array $element, Builder $query, bool $first = true) : string
|
||||
{
|
||||
|
|
@ -271,7 +262,6 @@ class Grammar extends GrammarAbstract
|
|||
* @throws \InvalidArgumentException Throws this exception if the value to compile is not supported by this function.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileValue($value, $prefix = '') : string
|
||||
{
|
||||
|
|
@ -313,7 +303,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileLimit(Builder $query, int $limit) : string
|
||||
{
|
||||
|
|
@ -329,7 +318,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileOffset(Builder $query, $offset) : string
|
||||
{
|
||||
|
|
@ -350,7 +338,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function compileGroups(Builder $query, array $groups)
|
||||
{
|
||||
|
|
@ -374,7 +361,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function compileOrders(Builder $query, array $orders) : string
|
||||
{
|
||||
|
|
@ -412,7 +398,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileInto(Builder $query, $table) : string
|
||||
{
|
||||
|
|
@ -428,7 +413,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileInserts(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
@ -454,7 +438,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileValues(Builder $query, array $values) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database\Query\Grammar
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -40,7 +36,6 @@ class MicrosoftGrammar extends Grammar
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileRandom(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database\Query\Grammar
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -49,7 +45,6 @@ class MysqlGrammar extends Grammar
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileRandom(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database\Query\Grammar
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -40,7 +36,6 @@ class OracleGrammar extends Grammar
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileRandom(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database\Query\Grammar
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -40,7 +36,6 @@ class PostgresGrammar extends Grammar
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileRandom(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -23,8 +21,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database\Query\Grammar
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -49,7 +45,6 @@ class SqliteGrammar extends Grammar
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileRandom(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database\Query;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Query type enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,15 +15,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database\Query;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Query type enum.
|
||||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Database\Query;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -17,7 +15,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database;
|
||||
|
||||
use phpOMS\Datatypes\Enum;
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Database type enum.
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\Datatypes\Enum;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\DataStorage\Database\Query;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -44,7 +40,6 @@ class Builder extends BuilderAbstract
|
|||
* @param ConnectionAbstract $connection Database connection
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(ConnectionAbstract $connection)
|
||||
{
|
||||
|
|
@ -82,7 +77,6 @@ class Builder extends BuilderAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function toSql() : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -22,8 +20,6 @@ namespace phpOMS\DataStorage\Database\Schema\Exception;
|
|||
*
|
||||
* @category System
|
||||
* @package Framework
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -38,7 +34,6 @@ class TableException extends \PDOException
|
|||
* @param \Exception Previous exception
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct(string $message, int $code = 0, \Exception $previous = null)
|
||||
{
|
||||
|
|
@ -53,7 +48,6 @@ class TableException extends \PDOException
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public static function findTable(string $message) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -26,8 +24,6 @@ use phpOMS\DataStorage\Database\Schema\QueryType;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -63,7 +59,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function compileComponents(BuilderAbstract $query) : array
|
||||
{
|
||||
|
|
@ -96,7 +91,6 @@ class Grammar extends GrammarAbstract
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileDrop(BuilderAbstract $query, array $tables) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -24,8 +22,6 @@ use phpOMS\DataStorage\Database\Query\Builder;
|
|||
*
|
||||
* @category Framework
|
||||
* @package phpOMS\DataStorage\Database
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @license OMS License 1.0
|
||||
* @link http://orange-management.com
|
||||
* @since 1.0.0
|
||||
|
|
@ -49,7 +45,6 @@ class MysqlGrammar extends Grammar
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileSelects(Builder $query, array $columns) : string
|
||||
{
|
||||
|
|
@ -71,7 +66,6 @@ class MysqlGrammar extends Grammar
|
|||
* @return string
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
protected function compileFrom(Builder $query, array $table) : string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user