Completed
Push — 5.1 ( eacfab...af1a7b )
by Rémi
9s
created
src/Exceptions/EntityMapNotFoundException.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 
7 7
 class EntityMapNotFoundException extends RuntimeException
8 8
 {
9
-    //
9
+	//
10 10
 }
Please login to merge, or discard this patch.
src/helpers.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use Analogue\ORM\System\Manager;
4 4
 
5
-if (! function_exists('analogue')) {
5
+if (!function_exists('analogue')) {
6 6
 
7 7
     /**
8 8
      * Return analogue's manager instance
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 }
18 18
 
19 19
 
20
-if (! function_exists('mapper')) {
20
+if (!function_exists('mapper')) {
21 21
 
22 22
     /**
23 23
      * Create a mapper for a given entity (static alias)
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -4,29 +4,29 @@
 block discarded – undo
4 4
 
5 5
 if (! function_exists('analogue')) {
6 6
 
7
-    /**
8
-     * Return analogue's manager instance
9
-     * 
10
-     * @return \Analogue\ORM\System\Manager
11
-     */
12
-    function analogue()
13
-    {
14
-        return Manager::getInstance();
15
-    }
7
+	/**
8
+	 * Return analogue's manager instance
9
+	 * 
10
+	 * @return \Analogue\ORM\System\Manager
11
+	 */
12
+	function analogue()
13
+	{
14
+		return Manager::getInstance();
15
+	}
16 16
 }
17 17
 
18 18
 
19 19
 if (! function_exists('mapper')) {
20 20
 
21
-    /**
22
-     * Create a mapper for a given entity (static alias)
23
-     * 
24
-     * @param \Analogue\ORM\Mappable|string $entity
25
-     * @param mixed $entityMap 
26
-     * @return Mapper
27
-     */
28
-    function mapper($entity, $entityMap = null)
29
-    {
30
-        return Manager::getMapper($entity, $entityMap);
31
-    }
21
+	/**
22
+	 * Create a mapper for a given entity (static alias)
23
+	 * 
24
+	 * @param \Analogue\ORM\Mappable|string $entity
25
+	 * @param mixed $entityMap 
26
+	 * @return Mapper
27
+	 */
28
+	function mapper($entity, $entityMap = null)
29
+	{
30
+		return Manager::getMapper($entity, $entityMap);
31
+	}
32 32
 }
Please login to merge, or discard this patch.
src/System/Wrappers/Wrapper.php 1 patch
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -11,117 +11,117 @@
 block discarded – undo
11 11
  */
12 12
 abstract class Wrapper implements InternallyMappable
13 13
 {
14
-    /**
15
-     * Original Entity Object
16
-     *
17
-     * @var mixed
18
-     */
19
-    protected $entity;
20
-
21
-    /**
22
-     * Corresponding EntityMap
23
-     *
24
-     * @var \Analogue\ORM\EntityMap
25
-     */
26
-    protected $entityMap;
27
-
28
-    /**
29
-     * Wrapper constructor.
30
-     * @param $entity
31
-     * @param $entityMap
32
-     */
33
-    public function __construct($entity, $entityMap)
34
-    {
35
-        $this->entity = $entity;
36
-        $this->entityMap = $entityMap;
37
-    }
38
-
39
-    /**
40
-     * Return the wrapped entity class
41
-     *
42
-     * @return mixed
43
-     */
44
-    public function getEntityClass()
45
-    {
46
-        return get_class($this->entity);
47
-    }
48
-
49
-    /**
50
-     * Returns the wrapped entity
51
-     *
52
-     * @return mixed
53
-     */
54
-    public function getObject()
55
-    {
56
-        return $this->entity;
57
-    }
58
-
59
-    /**
60
-     * Returns the wrapped entity's map
61
-     *
62
-     * @return mixed
63
-     */
64
-    public function getMap()
65
-    {
66
-        return $this->entityMap;
67
-    }
68
-
69
-    /**
70
-     * Set the lazyloading proxies on the wrapped entity objet
71
-     *
72
-     * @return void
73
-     */
74
-    public function setProxies()
75
-    {
76
-        $attributes = $this->getEntityAttributes();
77
-        $singleRelations = $this->entityMap->getSingleRelationships();
78
-        $manyRelations = $this->entityMap->getManyRelationships();
79
-
80
-        $proxies = [];
81
-
82
-        foreach ($this->entityMap->getRelationships() as $relation) {
83
-            if (!array_key_exists($relation, $attributes) || is_null($attributes[$relation])) {
84
-                if (in_array($relation, $singleRelations)) {
85
-                    $proxies[$relation] = new EntityProxy($this->getObject(), $relation);
86
-                }
87
-                if (in_array($relation, $manyRelations)) {
88
-                    $proxies[$relation] = new CollectionProxy($this->getObject(), $relation);
89
-                }
90
-            }
91
-        }
92
-
93
-        foreach ($proxies as $key => $value) {
94
-            $this->setEntityAttribute($key, $value);
95
-        }
96
-    }
97
-
98
-    /**
99
-     * @param string $key
100
-     * @param string $value
101
-     * @return mixed
102
-     */
103
-    abstract public function setEntityAttribute($key, $value);
104
-
105
-    /**
106
-     * @param string $key
107
-     * @return mixed
108
-     */
109
-    abstract public function getEntityAttribute($key);
110
-
111
-    /**
112
-     * @param array $attributes
113
-     * @return mixed
114
-     */
115
-    abstract public function setEntityAttributes(array $attributes);
116
-
117
-    /**
118
-     * @return mixed
119
-     */
120
-    abstract public function getEntityAttributes();
121
-
122
-    /**
123
-     * @param string $key
124
-     * @return mixed
125
-     */
126
-    abstract public function hasAttribute($key);
14
+	/**
15
+	 * Original Entity Object
16
+	 *
17
+	 * @var mixed
18
+	 */
19
+	protected $entity;
20
+
21
+	/**
22
+	 * Corresponding EntityMap
23
+	 *
24
+	 * @var \Analogue\ORM\EntityMap
25
+	 */
26
+	protected $entityMap;
27
+
28
+	/**
29
+	 * Wrapper constructor.
30
+	 * @param $entity
31
+	 * @param $entityMap
32
+	 */
33
+	public function __construct($entity, $entityMap)
34
+	{
35
+		$this->entity = $entity;
36
+		$this->entityMap = $entityMap;
37
+	}
38
+
39
+	/**
40
+	 * Return the wrapped entity class
41
+	 *
42
+	 * @return mixed
43
+	 */
44
+	public function getEntityClass()
45
+	{
46
+		return get_class($this->entity);
47
+	}
48
+
49
+	/**
50
+	 * Returns the wrapped entity
51
+	 *
52
+	 * @return mixed
53
+	 */
54
+	public function getObject()
55
+	{
56
+		return $this->entity;
57
+	}
58
+
59
+	/**
60
+	 * Returns the wrapped entity's map
61
+	 *
62
+	 * @return mixed
63
+	 */
64
+	public function getMap()
65
+	{
66
+		return $this->entityMap;
67
+	}
68
+
69
+	/**
70
+	 * Set the lazyloading proxies on the wrapped entity objet
71
+	 *
72
+	 * @return void
73
+	 */
74
+	public function setProxies()
75
+	{
76
+		$attributes = $this->getEntityAttributes();
77
+		$singleRelations = $this->entityMap->getSingleRelationships();
78
+		$manyRelations = $this->entityMap->getManyRelationships();
79
+
80
+		$proxies = [];
81
+
82
+		foreach ($this->entityMap->getRelationships() as $relation) {
83
+			if (!array_key_exists($relation, $attributes) || is_null($attributes[$relation])) {
84
+				if (in_array($relation, $singleRelations)) {
85
+					$proxies[$relation] = new EntityProxy($this->getObject(), $relation);
86
+				}
87
+				if (in_array($relation, $manyRelations)) {
88
+					$proxies[$relation] = new CollectionProxy($this->getObject(), $relation);
89
+				}
90
+			}
91
+		}
92
+
93
+		foreach ($proxies as $key => $value) {
94
+			$this->setEntityAttribute($key, $value);
95
+		}
96
+	}
97
+
98
+	/**
99
+	 * @param string $key
100
+	 * @param string $value
101
+	 * @return mixed
102
+	 */
103
+	abstract public function setEntityAttribute($key, $value);
104
+
105
+	/**
106
+	 * @param string $key
107
+	 * @return mixed
108
+	 */
109
+	abstract public function getEntityAttribute($key);
110
+
111
+	/**
112
+	 * @param array $attributes
113
+	 * @return mixed
114
+	 */
115
+	abstract public function setEntityAttributes(array $attributes);
116
+
117
+	/**
118
+	 * @return mixed
119
+	 */
120
+	abstract public function getEntityAttributes();
121
+
122
+	/**
123
+	 * @param string $key
124
+	 * @return mixed
125
+	 */
126
+	abstract public function hasAttribute($key);
127 127
 }
Please login to merge, or discard this patch.