@@ -3,38 +3,38 @@ |
||
| 3 | 3 | interface InternallyMappable |
| 4 | 4 | { |
| 5 | 5 | |
| 6 | - /** |
|
| 7 | - * Set the object attribute raw values (hydration) |
|
| 8 | - * |
|
| 9 | - * @param array $attributes |
|
| 10 | - */ |
|
| 11 | - public function setEntityAttributes(array $attributes); |
|
| 6 | + /** |
|
| 7 | + * Set the object attribute raw values (hydration) |
|
| 8 | + * |
|
| 9 | + * @param array $attributes |
|
| 10 | + */ |
|
| 11 | + public function setEntityAttributes(array $attributes); |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Get the raw object's values. |
|
| 15 | - * |
|
| 16 | - * @return array |
|
| 17 | - */ |
|
| 18 | - public function getEntityAttributes(); |
|
| 13 | + /** |
|
| 14 | + * Get the raw object's values. |
|
| 15 | + * |
|
| 16 | + * @return array |
|
| 17 | + */ |
|
| 18 | + public function getEntityAttributes(); |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Set the raw entity attributes |
|
| 22 | - * @param string $key |
|
| 23 | - * @param string $value |
|
| 24 | - */ |
|
| 25 | - public function setEntityAttribute($key, $value); |
|
| 20 | + /** |
|
| 21 | + * Set the raw entity attributes |
|
| 22 | + * @param string $key |
|
| 23 | + * @param string $value |
|
| 24 | + */ |
|
| 25 | + public function setEntityAttribute($key, $value); |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Return the entity's attribute |
|
| 29 | - * @param string $key |
|
| 30 | - * @return mixed |
|
| 31 | - */ |
|
| 32 | - public function getEntityAttribute($key); |
|
| 27 | + /** |
|
| 28 | + * Return the entity's attribute |
|
| 29 | + * @param string $key |
|
| 30 | + * @return mixed |
|
| 31 | + */ |
|
| 32 | + public function getEntityAttribute($key); |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Does the entity posses the given attribute |
|
| 36 | - * @param string $key |
|
| 37 | - * @return boolean |
|
| 38 | - */ |
|
| 39 | - public function hasAttribute($key); |
|
| 34 | + /** |
|
| 35 | + * Does the entity posses the given attribute |
|
| 36 | + * @param string $key |
|
| 37 | + * @return boolean |
|
| 38 | + */ |
|
| 39 | + public function hasAttribute($key); |
|
| 40 | 40 | } |
@@ -3,17 +3,17 @@ |
||
| 3 | 3 | interface AnaloguePluginInterface |
| 4 | 4 | { |
| 5 | 5 | |
| 6 | - /** |
|
| 7 | - * Boot the plugin |
|
| 8 | - * |
|
| 9 | - * @return void |
|
| 10 | - */ |
|
| 11 | - public function register(); |
|
| 6 | + /** |
|
| 7 | + * Boot the plugin |
|
| 8 | + * |
|
| 9 | + * @return void |
|
| 10 | + */ |
|
| 11 | + public function register(); |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Get custom events provided by the plugin |
|
| 15 | - * |
|
| 16 | - * @return array |
|
| 17 | - */ |
|
| 18 | - public function getCustomEvents(); |
|
| 13 | + /** |
|
| 14 | + * Get custom events provided by the plugin |
|
| 15 | + * |
|
| 16 | + * @return array |
|
| 17 | + */ |
|
| 18 | + public function getCustomEvents(); |
|
| 19 | 19 | } |
@@ -4,67 +4,67 @@ |
||
| 4 | 4 | |
| 5 | 5 | class ValueMap |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * @var string |
|
| 9 | - */ |
|
| 10 | - protected $name; |
|
| 7 | + /** |
|
| 8 | + * @var string |
|
| 9 | + */ |
|
| 10 | + protected $name; |
|
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * @var string |
|
| 14 | - */ |
|
| 15 | - protected $class; |
|
| 12 | + /** |
|
| 13 | + * @var string |
|
| 14 | + */ |
|
| 15 | + protected $class; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @var array |
|
| 19 | - */ |
|
| 20 | - protected $embeddables = []; |
|
| 17 | + /** |
|
| 18 | + * @var array |
|
| 19 | + */ |
|
| 20 | + protected $embeddables = []; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @var array |
|
| 24 | - */ |
|
| 25 | - protected $attributes = []; |
|
| 22 | + /** |
|
| 23 | + * @var array |
|
| 24 | + */ |
|
| 25 | + protected $attributes = []; |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @return array |
|
| 29 | - */ |
|
| 30 | - public function getAttributes() |
|
| 31 | - { |
|
| 32 | - return $this->attributes; |
|
| 33 | - } |
|
| 27 | + /** |
|
| 28 | + * @return array |
|
| 29 | + */ |
|
| 30 | + public function getAttributes() |
|
| 31 | + { |
|
| 32 | + return $this->attributes; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @return array |
|
| 37 | - */ |
|
| 38 | - public function getEmbeddables() |
|
| 39 | - { |
|
| 40 | - return $this->embeddables; |
|
| 41 | - } |
|
| 35 | + /** |
|
| 36 | + * @return array |
|
| 37 | + */ |
|
| 38 | + public function getEmbeddables() |
|
| 39 | + { |
|
| 40 | + return $this->embeddables; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @param $class |
|
| 45 | - */ |
|
| 46 | - public function setClass($class) |
|
| 47 | - { |
|
| 48 | - $this->class = $class; |
|
| 49 | - } |
|
| 43 | + /** |
|
| 44 | + * @param $class |
|
| 45 | + */ |
|
| 46 | + public function setClass($class) |
|
| 47 | + { |
|
| 48 | + $this->class = $class; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * @return mixed |
|
| 53 | - */ |
|
| 54 | - public function getClass() |
|
| 55 | - { |
|
| 56 | - return $this->class; |
|
| 57 | - } |
|
| 51 | + /** |
|
| 52 | + * @return mixed |
|
| 53 | + */ |
|
| 54 | + public function getClass() |
|
| 55 | + { |
|
| 56 | + return $this->class; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * @return string |
|
| 61 | - */ |
|
| 62 | - public function getName() |
|
| 63 | - { |
|
| 64 | - if (isset($this->name)) { |
|
| 65 | - return $this->name; |
|
| 66 | - } else { |
|
| 67 | - return class_basename($this); |
|
| 68 | - } |
|
| 69 | - } |
|
| 59 | + /** |
|
| 60 | + * @return string |
|
| 61 | + */ |
|
| 62 | + public function getName() |
|
| 63 | + { |
|
| 64 | + if (isset($this->name)) { |
|
| 65 | + return $this->name; |
|
| 66 | + } else { |
|
| 67 | + return class_basename($this); |
|
| 68 | + } |
|
| 69 | + } |
|
| 70 | 70 | } |
@@ -6,28 +6,28 @@ |
||
| 6 | 6 | |
| 7 | 7 | class IlluminateConnectionProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * @var DatabaseManager |
|
| 11 | - */ |
|
| 12 | - protected $db; |
|
| 9 | + /** |
|
| 10 | + * @var DatabaseManager |
|
| 11 | + */ |
|
| 12 | + protected $db; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * IlluminateConnectionProvider constructor. |
|
| 16 | - * @param DatabaseManager $db |
|
| 17 | - */ |
|
| 18 | - public function __construct(DatabaseManager $db) |
|
| 19 | - { |
|
| 20 | - $this->db = $db; |
|
| 21 | - } |
|
| 14 | + /** |
|
| 15 | + * IlluminateConnectionProvider constructor. |
|
| 16 | + * @param DatabaseManager $db |
|
| 17 | + */ |
|
| 18 | + public function __construct(DatabaseManager $db) |
|
| 19 | + { |
|
| 20 | + $this->db = $db; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Get a Database connection object |
|
| 25 | - * |
|
| 26 | - * @param $name |
|
| 27 | - * @return \Illuminate\Database\Connection |
|
| 28 | - */ |
|
| 29 | - public function connection($name = null) |
|
| 30 | - { |
|
| 31 | - return $this->db->connection($name); |
|
| 32 | - } |
|
| 23 | + /** |
|
| 24 | + * Get a Database connection object |
|
| 25 | + * |
|
| 26 | + * @param $name |
|
| 27 | + * @return \Illuminate\Database\Connection |
|
| 28 | + */ |
|
| 29 | + public function connection($name = null) |
|
| 30 | + { |
|
| 31 | + return $this->db->connection($name); |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -4,32 +4,32 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Manager |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * @var DriverInterface[] |
|
| 9 | - */ |
|
| 10 | - protected $drivers = []; |
|
| 7 | + /** |
|
| 8 | + * @var DriverInterface[] |
|
| 9 | + */ |
|
| 10 | + protected $drivers = []; |
|
| 11 | 11 | |
| 12 | - /** |
|
| 13 | - * Add a Mapping Driver |
|
| 14 | - * |
|
| 15 | - * @param DriverInterface $driver |
|
| 16 | - */ |
|
| 17 | - public function addDriver(DriverInterface $driver) |
|
| 18 | - { |
|
| 19 | - $this->drivers[$driver->getName()] = $driver; |
|
| 20 | - } |
|
| 12 | + /** |
|
| 13 | + * Add a Mapping Driver |
|
| 14 | + * |
|
| 15 | + * @param DriverInterface $driver |
|
| 16 | + */ |
|
| 17 | + public function addDriver(DriverInterface $driver) |
|
| 18 | + { |
|
| 19 | + $this->drivers[$driver->getName()] = $driver; |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Get the DBAdapter |
|
| 24 | - * |
|
| 25 | - * @param string $driver |
|
| 26 | - * @param string $connection connection name for drivers supporting multiple connection. |
|
| 27 | - * @return DriverInterface|void |
|
| 28 | - */ |
|
| 29 | - public function getAdapter($driver, $connection = null) |
|
| 30 | - { |
|
| 31 | - if (array_key_exists($driver, $this->drivers)) { |
|
| 32 | - return $this->drivers[$driver]->getAdapter($connection); |
|
| 33 | - } |
|
| 34 | - } |
|
| 22 | + /** |
|
| 23 | + * Get the DBAdapter |
|
| 24 | + * |
|
| 25 | + * @param string $driver |
|
| 26 | + * @param string $connection connection name for drivers supporting multiple connection. |
|
| 27 | + * @return DriverInterface|void |
|
| 28 | + */ |
|
| 29 | + public function getAdapter($driver, $connection = null) |
|
| 30 | + { |
|
| 31 | + if (array_key_exists($driver, $this->drivers)) { |
|
| 32 | + return $this->drivers[$driver]->getAdapter($connection); |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -6,28 +6,28 @@ |
||
| 6 | 6 | |
| 7 | 7 | class CapsuleConnectionProvider |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * @var Capsule |
|
| 11 | - */ |
|
| 12 | - protected $capsule; |
|
| 9 | + /** |
|
| 10 | + * @var Capsule |
|
| 11 | + */ |
|
| 12 | + protected $capsule; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * CapsuleConnectionProvider constructor. |
|
| 16 | - * @param Capsule $capsule |
|
| 17 | - */ |
|
| 18 | - public function __construct(Capsule $capsule) |
|
| 19 | - { |
|
| 20 | - $this->capsule = $capsule; |
|
| 21 | - } |
|
| 14 | + /** |
|
| 15 | + * CapsuleConnectionProvider constructor. |
|
| 16 | + * @param Capsule $capsule |
|
| 17 | + */ |
|
| 18 | + public function __construct(Capsule $capsule) |
|
| 19 | + { |
|
| 20 | + $this->capsule = $capsule; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Get a Database connection object |
|
| 25 | - * |
|
| 26 | - * @param $name |
|
| 27 | - * @return \Illuminate\Database\Connection |
|
| 28 | - */ |
|
| 29 | - public function connection($name = null) |
|
| 30 | - { |
|
| 31 | - return $this->capsule->getConnection($name); |
|
| 32 | - } |
|
| 23 | + /** |
|
| 24 | + * Get a Database connection object |
|
| 25 | + * |
|
| 26 | + * @param $name |
|
| 27 | + * @return \Illuminate\Database\Connection |
|
| 28 | + */ |
|
| 29 | + public function connection($name = null) |
|
| 30 | + { |
|
| 31 | + return $this->capsule->getConnection($name); |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -4,16 +4,16 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface DriverInterface |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Return the name of the driver |
|
| 9 | - * @return string |
|
| 10 | - */ |
|
| 11 | - public function getName(); |
|
| 7 | + /** |
|
| 8 | + * Return the name of the driver |
|
| 9 | + * @return string |
|
| 10 | + */ |
|
| 11 | + public function getName(); |
|
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Get Analogue DB Adapter |
|
| 15 | - * @param string $connection connection name for drivers supporting multiple connections |
|
| 16 | - * @return \Analogue\ORM\Drivers\DBAdapter |
|
| 17 | - */ |
|
| 18 | - public function getAdapter($connection = null); |
|
| 13 | + /** |
|
| 14 | + * Get Analogue DB Adapter |
|
| 15 | + * @param string $connection connection name for drivers supporting multiple connections |
|
| 16 | + * @return \Analogue\ORM\Drivers\DBAdapter |
|
| 17 | + */ |
|
| 18 | + public function getAdapter($connection = null); |
|
| 19 | 19 | } |
@@ -4,42 +4,42 @@ |
||
| 4 | 4 | |
| 5 | 5 | class IlluminateDriver implements DriverInterface |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * The Illuminate Connection Provider |
|
| 9 | - * |
|
| 10 | - * @var CapsuleConnectionProvider|IlluminateConnectionProvider |
|
| 11 | - */ |
|
| 12 | - protected $connectionProvider; |
|
| 7 | + /** |
|
| 8 | + * The Illuminate Connection Provider |
|
| 9 | + * |
|
| 10 | + * @var CapsuleConnectionProvider|IlluminateConnectionProvider |
|
| 11 | + */ |
|
| 12 | + protected $connectionProvider; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * IlluminateDriver constructor. |
|
| 16 | - * @param $connectionProvider |
|
| 17 | - */ |
|
| 18 | - public function __construct($connectionProvider) |
|
| 19 | - { |
|
| 20 | - $this->connectionProvider = $connectionProvider; |
|
| 21 | - } |
|
| 14 | + /** |
|
| 15 | + * IlluminateDriver constructor. |
|
| 16 | + * @param $connectionProvider |
|
| 17 | + */ |
|
| 18 | + public function __construct($connectionProvider) |
|
| 19 | + { |
|
| 20 | + $this->connectionProvider = $connectionProvider; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Return the name of the driver |
|
| 25 | - * |
|
| 26 | - * @return string |
|
| 27 | - */ |
|
| 28 | - public function getName() |
|
| 29 | - { |
|
| 30 | - return 'illuminate'; |
|
| 31 | - } |
|
| 23 | + /** |
|
| 24 | + * Return the name of the driver |
|
| 25 | + * |
|
| 26 | + * @return string |
|
| 27 | + */ |
|
| 28 | + public function getName() |
|
| 29 | + { |
|
| 30 | + return 'illuminate'; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Get Analogue DBAdapter |
|
| 35 | - * |
|
| 36 | - * @param string|null $connection |
|
| 37 | - * @return IlluminateDBAdapter |
|
| 38 | - */ |
|
| 39 | - public function getAdapter($connection = null) |
|
| 40 | - { |
|
| 41 | - $connection = $this->connectionProvider->connection($connection); |
|
| 33 | + /** |
|
| 34 | + * Get Analogue DBAdapter |
|
| 35 | + * |
|
| 36 | + * @param string|null $connection |
|
| 37 | + * @return IlluminateDBAdapter |
|
| 38 | + */ |
|
| 39 | + public function getAdapter($connection = null) |
|
| 40 | + { |
|
| 41 | + $connection = $this->connectionProvider->connection($connection); |
|
| 42 | 42 | |
| 43 | - return new IlluminateDBAdapter($connection); |
|
| 44 | - } |
|
| 43 | + return new IlluminateDBAdapter($connection); |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -4,38 +4,38 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface DBAdapter |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * Return's Driver specific Query Implementation |
|
| 9 | - * |
|
| 10 | - * @return \Analogue\ORM\Drivers\QueryAdapter|\Analogue\ORM\Drivers\IlluminateQueryAdapter |
|
| 11 | - */ |
|
| 12 | - public function getQuery(); |
|
| 7 | + /** |
|
| 8 | + * Return's Driver specific Query Implementation |
|
| 9 | + * |
|
| 10 | + * @return \Analogue\ORM\Drivers\QueryAdapter|\Analogue\ORM\Drivers\IlluminateQueryAdapter |
|
| 11 | + */ |
|
| 12 | + public function getQuery(); |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Return the Date format used on this adapter |
|
| 16 | - * |
|
| 17 | - * @return string |
|
| 18 | - */ |
|
| 19 | - public function getDateFormat(); |
|
| 14 | + /** |
|
| 15 | + * Return the Date format used on this adapter |
|
| 16 | + * |
|
| 17 | + * @return string |
|
| 18 | + */ |
|
| 19 | + public function getDateFormat(); |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * Start a DB transaction on driver that supports it. |
|
| 23 | - * |
|
| 24 | - * @return void |
|
| 25 | - */ |
|
| 26 | - public function beginTransaction(); |
|
| 21 | + /** |
|
| 22 | + * Start a DB transaction on driver that supports it. |
|
| 23 | + * |
|
| 24 | + * @return void |
|
| 25 | + */ |
|
| 26 | + public function beginTransaction(); |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Commit a DB transaction on driver that supports it. |
|
| 30 | - * |
|
| 31 | - * @return void |
|
| 32 | - */ |
|
| 33 | - public function commit(); |
|
| 28 | + /** |
|
| 29 | + * Commit a DB transaction on driver that supports it. |
|
| 30 | + * |
|
| 31 | + * @return void |
|
| 32 | + */ |
|
| 33 | + public function commit(); |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Rollback a DB transaction on driver that supports it. |
|
| 37 | - * |
|
| 38 | - * @return void |
|
| 39 | - */ |
|
| 40 | - public function rollback(); |
|
| 35 | + /** |
|
| 36 | + * Rollback a DB transaction on driver that supports it. |
|
| 37 | + * |
|
| 38 | + * @return void |
|
| 39 | + */ |
|
| 40 | + public function rollback(); |
|
| 41 | 41 | } |