@@ -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 | } |
@@ -8,13 +8,13 @@ |
||
8 | 8 | class AnalogueFacade extends Facade |
9 | 9 | { |
10 | 10 | |
11 | - /** |
|
12 | - * Get the registered name of the component. |
|
13 | - * |
|
14 | - * @return string |
|
15 | - */ |
|
16 | - protected static function getFacadeAccessor() |
|
17 | - { |
|
18 | - return 'analogue'; |
|
19 | - } |
|
11 | + /** |
|
12 | + * Get the registered name of the component. |
|
13 | + * |
|
14 | + * @return string |
|
15 | + */ |
|
16 | + protected static function getFacadeAccessor() |
|
17 | + { |
|
18 | + return 'analogue'; |
|
19 | + } |
|
20 | 20 | } |
@@ -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 | } |
@@ -12,53 +12,53 @@ |
||
12 | 12 | class AnalogueServiceProvider extends ServiceProvider |
13 | 13 | { |
14 | 14 | |
15 | - /** |
|
16 | - * Indicates if loading of the provider is deferred. |
|
17 | - * |
|
18 | - * @var bool |
|
19 | - */ |
|
20 | - protected $defer = false; |
|
15 | + /** |
|
16 | + * Indicates if loading of the provider is deferred. |
|
17 | + * |
|
18 | + * @var bool |
|
19 | + */ |
|
20 | + protected $defer = false; |
|
21 | 21 | |
22 | - public function boot() |
|
23 | - { |
|
24 | - $manager = $this->app->make('analogue'); |
|
22 | + public function boot() |
|
23 | + { |
|
24 | + $manager = $this->app->make('analogue'); |
|
25 | 25 | |
26 | - $manager->registerPlugin('Analogue\ORM\Plugins\Timestamps\TimestampsPlugin'); |
|
27 | - $manager->registerPlugin('Analogue\ORM\Plugins\SoftDeletes\SoftDeletesPlugin'); |
|
28 | - } |
|
26 | + $manager->registerPlugin('Analogue\ORM\Plugins\Timestamps\TimestampsPlugin'); |
|
27 | + $manager->registerPlugin('Analogue\ORM\Plugins\SoftDeletes\SoftDeletesPlugin'); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * Register the service provider. |
|
32 | - * |
|
33 | - * @return void |
|
34 | - */ |
|
35 | - public function register() |
|
36 | - { |
|
37 | - $this->app->singleton('analogue', function ($app) { |
|
30 | + /** |
|
31 | + * Register the service provider. |
|
32 | + * |
|
33 | + * @return void |
|
34 | + */ |
|
35 | + public function register() |
|
36 | + { |
|
37 | + $this->app->singleton('analogue', function ($app) { |
|
38 | 38 | |
39 | - $db = $app['db']; |
|
39 | + $db = $app['db']; |
|
40 | 40 | |
41 | - $connectionProvider = new IlluminateConnectionProvider($db); |
|
41 | + $connectionProvider = new IlluminateConnectionProvider($db); |
|
42 | 42 | |
43 | - $illuminate = new IlluminateDriver($connectionProvider); |
|
43 | + $illuminate = new IlluminateDriver($connectionProvider); |
|
44 | 44 | |
45 | - $driverManager = new DriverManager; |
|
45 | + $driverManager = new DriverManager; |
|
46 | 46 | |
47 | - $driverManager->addDriver($illuminate); |
|
47 | + $driverManager->addDriver($illuminate); |
|
48 | 48 | |
49 | - $event = $app->make('events'); |
|
49 | + $event = $app->make('events'); |
|
50 | 50 | |
51 | - return new Manager($driverManager, $event); |
|
52 | - }); |
|
53 | - } |
|
51 | + return new Manager($driverManager, $event); |
|
52 | + }); |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * Get the services provided by the provider. |
|
57 | - * |
|
58 | - * @return array |
|
59 | - */ |
|
60 | - public function provides() |
|
61 | - { |
|
62 | - return ['analogue']; |
|
63 | - } |
|
55 | + /** |
|
56 | + * Get the services provided by the provider. |
|
57 | + * |
|
58 | + * @return array |
|
59 | + */ |
|
60 | + public function provides() |
|
61 | + { |
|
62 | + return ['analogue']; |
|
63 | + } |
|
64 | 64 | } |
@@ -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 | } |
@@ -12,27 +12,27 @@ |
||
12 | 12 | */ |
13 | 13 | class IlluminateQueryAdapter implements QueryAdapter |
14 | 14 | { |
15 | - /** |
|
16 | - * @var Builder |
|
17 | - */ |
|
18 | - protected $query; |
|
15 | + /** |
|
16 | + * @var Builder |
|
17 | + */ |
|
18 | + protected $query; |
|
19 | 19 | |
20 | - /** |
|
21 | - * IlluminateQueryAdapter constructor. |
|
22 | - * @param Builder $query |
|
23 | - */ |
|
24 | - public function __construct(Builder $query) |
|
25 | - { |
|
26 | - $this->query = $query; |
|
27 | - } |
|
20 | + /** |
|
21 | + * IlluminateQueryAdapter constructor. |
|
22 | + * @param Builder $query |
|
23 | + */ |
|
24 | + public function __construct(Builder $query) |
|
25 | + { |
|
26 | + $this->query = $query; |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * @param $method |
|
31 | - * @param $parameters |
|
32 | - * @return mixed |
|
33 | - */ |
|
34 | - public function __call($method, $parameters) |
|
35 | - { |
|
36 | - return call_user_func_array([$this->query, $method], $parameters); |
|
37 | - } |
|
29 | + /** |
|
30 | + * @param $method |
|
31 | + * @param $parameters |
|
32 | + * @return mixed |
|
33 | + */ |
|
34 | + public function __call($method, $parameters) |
|
35 | + { |
|
36 | + return call_user_func_array([$this->query, $method], $parameters); |
|
37 | + } |
|
38 | 38 | } |
@@ -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 | } |
@@ -11,70 +11,70 @@ |
||
11 | 11 | */ |
12 | 12 | class IlluminateDBAdapter implements DBAdapter |
13 | 13 | { |
14 | - /** |
|
15 | - * @var Connection |
|
16 | - */ |
|
17 | - protected $connection; |
|
14 | + /** |
|
15 | + * @var Connection |
|
16 | + */ |
|
17 | + protected $connection; |
|
18 | 18 | |
19 | - /** |
|
20 | - * IlluminateDBAdapter constructor. |
|
21 | - * @param Connection $connection |
|
22 | - */ |
|
23 | - public function __construct(Connection $connection) |
|
24 | - { |
|
25 | - $this->connection = $connection; |
|
26 | - } |
|
19 | + /** |
|
20 | + * IlluminateDBAdapter constructor. |
|
21 | + * @param Connection $connection |
|
22 | + */ |
|
23 | + public function __construct(Connection $connection) |
|
24 | + { |
|
25 | + $this->connection = $connection; |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Return a new Query instance for this driver |
|
30 | - * |
|
31 | - * @return QueryAdapter |
|
32 | - */ |
|
33 | - public function getQuery() |
|
34 | - { |
|
35 | - $connection = $this->connection; |
|
28 | + /** |
|
29 | + * Return a new Query instance for this driver |
|
30 | + * |
|
31 | + * @return QueryAdapter |
|
32 | + */ |
|
33 | + public function getQuery() |
|
34 | + { |
|
35 | + $connection = $this->connection; |
|
36 | 36 | |
37 | - $grammar = $connection->getQueryGrammar(); |
|
37 | + $grammar = $connection->getQueryGrammar(); |
|
38 | 38 | |
39 | - $queryBuilder = new QueryBuilder($connection, $grammar, $connection->getPostProcessor()); |
|
39 | + $queryBuilder = new QueryBuilder($connection, $grammar, $connection->getPostProcessor()); |
|
40 | 40 | |
41 | - return new IlluminateQueryAdapter($queryBuilder); |
|
42 | - } |
|
41 | + return new IlluminateQueryAdapter($queryBuilder); |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * Get the date format supported by the current connection |
|
46 | - * |
|
47 | - * @return string |
|
48 | - */ |
|
49 | - public function getDateFormat() |
|
50 | - { |
|
51 | - return $this->connection->getQueryGrammar()->getDateFormat(); |
|
52 | - } |
|
44 | + /** |
|
45 | + * Get the date format supported by the current connection |
|
46 | + * |
|
47 | + * @return string |
|
48 | + */ |
|
49 | + public function getDateFormat() |
|
50 | + { |
|
51 | + return $this->connection->getQueryGrammar()->getDateFormat(); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * Start a DB transaction on driver that supports it. |
|
56 | - * @return void |
|
57 | - */ |
|
58 | - public function beginTransaction() |
|
59 | - { |
|
60 | - $this->connection->beginTransaction(); |
|
61 | - } |
|
54 | + /** |
|
55 | + * Start a DB transaction on driver that supports it. |
|
56 | + * @return void |
|
57 | + */ |
|
58 | + public function beginTransaction() |
|
59 | + { |
|
60 | + $this->connection->beginTransaction(); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Commit a DB transaction on driver that supports it. |
|
65 | - * @return void |
|
66 | - */ |
|
67 | - public function commit() |
|
68 | - { |
|
69 | - $this->connection->commit(); |
|
70 | - } |
|
63 | + /** |
|
64 | + * Commit a DB transaction on driver that supports it. |
|
65 | + * @return void |
|
66 | + */ |
|
67 | + public function commit() |
|
68 | + { |
|
69 | + $this->connection->commit(); |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * Rollback a DB transaction |
|
74 | - * @return void |
|
75 | - */ |
|
76 | - public function rollback() |
|
77 | - { |
|
78 | - $this->connection->rollBack(); |
|
79 | - } |
|
72 | + /** |
|
73 | + * Rollback a DB transaction |
|
74 | + * @return void |
|
75 | + */ |
|
76 | + public function rollback() |
|
77 | + { |
|
78 | + $this->connection->rollBack(); |
|
79 | + } |
|
80 | 80 | } |
@@ -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 | } |