Completed
Branch develop (981d8e)
by Oyebanji Jacob
04:12 queued 01:59
created
test/DatabaseConnectionStringFactoryTest.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 class DatabaseConnectionStringFactoryTest extends PHPUnit_Framework_TestCase
6 6
 {
7
-     /**
8
-     * The instance of DatabaseConnectionStringFactory used in the test.
9
-     *
10
-     * @var Pyjac\ORM\DatabaseConnectionStringFactory
11
-     */
7
+        /**
8
+         * The instance of DatabaseConnectionStringFactory used in the test.
9
+         *
10
+         * @var Pyjac\ORM\DatabaseConnectionStringFactory
11
+         */
12 12
     protected $openSourceEvangelistFactory;
13 13
 
14 14
     /**
Please login to merge, or discard this patch.
src/Model.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -146,28 +146,28 @@  discard block
 block discarded – undo
146 146
 
147 147
     /**
148 148
      * Store instance of database connection used.
149
-    * @var [type]
150
-    */
149
+     * @var [type]
150
+     */
151 151
     protected  $databaseConnection;
152 152
 
153
-     public function __construct()
153
+        public function __construct()
154 154
     {
155 155
         $this->databaseConnection = DatabaseConnection::getInstance()->databaseConnection;
156 156
         //$databaseConnection->databaseConnection->connect();
157 157
     }
158 158
     /**
159
-    * @param string $key rep column name
160
-    * @param string $val rep column value
161
-    * sets into $propertie the $key => $value pairs
162
-    */
159
+     * @param string $key rep column name
160
+     * @param string $val rep column value
161
+     * sets into $propertie the $key => $value pairs
162
+     */
163 163
     public  function __set($key, $val)
164 164
     {
165 165
         $this->properties[$key] = $val;
166 166
     }
167 167
     /**
168
-    * @param string $key reps the column name
169
-    * @return $key and $value
170
-    */
168
+     * @param string $key reps the column name
169
+     * @return $key and $value
170
+     */
171 171
     public function __get($key)
172 172
     {
173 173
         return $this->properties[$key];
@@ -177,17 +177,17 @@  discard block
 block discarded – undo
177 177
      *
178 178
      * @return array
179 179
      */
180
-     public function getProperties()
181
-     {
182
-         return $this->properties;
183
-     }
180
+        public function getProperties()
181
+        {
182
+            return $this->properties;
183
+        }
184 184
     /**
185
-    * Gets the name of the child class only
186
-    * without the namespace
187
-    * @var $className
188
-    * @var $table
189
-    * @return $table
190
-    */
185
+     * Gets the name of the child class only
186
+     * without the namespace
187
+     * @var $className
188
+     * @var $table
189
+     * @return $table
190
+     */
191 191
     public function getTableName()
192 192
     {
193 193
         $className = explode('\\', get_called_class());
@@ -195,22 +195,22 @@  discard block
 block discarded – undo
195 195
         return $table;
196 196
     }
197 197
     /**
198
-    * returns a particular record
199
-    * @param $id reps the record id
200
-    * @param $connection initialised to null
201
-    * @return object
202
-    */
198
+     * returns a particular record
199
+     * @param $id reps the record id
200
+     * @param $connection initialised to null
201
+     * @return object
202
+     */
203 203
     public static function find($id)
204 204
     {
205 205
         $model = new static;
206 206
         return $model->get($id); 
207 207
     }
208 208
     /**
209
-    * returns a particular record
210
-    * @param $id reps the record id
211
-    * @param $connection initialised to null
212
-    * @return object
213
-    */
209
+     * returns a particular record
210
+     * @param $id reps the record id
211
+     * @param $connection initialised to null
212
+     * @return object
213
+     */
214 214
     public function get($id)
215 215
     {
216 216
         $sql = "SELECT * FROM {$this->getTableName()} WHERE id={$id}";
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 
240 240
     }
241 241
     /** update table with instance properties
242
-    *
243
-    */
242
+     *
243
+     */
244 244
     private function update()
245 245
     {
246 246
         $connection = $this->getConnection();
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
         return $stmt->rowCount();
267 267
     }
268 268
     /**
269
-    * insert instance data into the table
270
-    */
269
+     * insert instance data into the table
270
+     */
271 271
     private function create()
272 272
     {
273 273
         $connection = $this->getConnection();
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
         return $stmt->rowCount();
300 300
     }
301 301
     /**
302
-    * get db connection
303
-    */
302
+     * get db connection
303
+     */
304 304
     public function getConnection($connection = null)
305 305
     {
306 306
         if(is_null($connection))
@@ -309,10 +309,10 @@  discard block
 block discarded – undo
309 309
         }
310 310
     }
311 311
     /**
312
-    * checks if the id exists
313
-    * update if exist
314
-    * create if not exist
315
-    */
312
+     * checks if the id exists
313
+     * update if exist
314
+     * create if not exist
315
+     */
316 316
     public function save()
317 317
     {
318 318
         if ($this->id) {
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
         }
323 323
     }
324 324
     /**
325
-    * @param row reps record id
326
-    * @param $connection initialised to null
327
-    * @return boolean
328
-    */
325
+     * @param row reps record id
326
+     * @param $connection initialised to null
327
+     * @return boolean
328
+     */
329 329
     public static function destroy($id)
330 330
     {
331 331
         
Please login to merge, or discard this patch.