@@ -76,7 +76,6 @@ discard block |
||
| 76 | 76 | private $_with = Array(); |
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | - * @param array $data Data to preload on object creation |
|
| 80 | 79 | */ |
| 81 | 80 | public function __construct() { |
| 82 | 81 | $this->db = app('db')->connect($this->dbConn); |
@@ -207,7 +206,7 @@ discard block |
||
| 207 | 206 | /** |
| 208 | 207 | * Save or Update object |
| 209 | 208 | * |
| 210 | - * @return mixed insert id or false in case of failure |
|
| 209 | + * @return boolean insert id or false in case of failure |
|
| 211 | 210 | */ |
| 212 | 211 | public function save($data = null) { |
| 213 | 212 | if ($this->isNew) |
@@ -216,7 +215,7 @@ discard block |
||
| 216 | 215 | } |
| 217 | 216 | |
| 218 | 217 | /** |
| 219 | - * @return mixed insert id or false in case of failure |
|
| 218 | + * @return boolean insert id or false in case of failure |
|
| 220 | 219 | */ |
| 221 | 220 | public function insert() { |
| 222 | 221 | if (!empty ($this->timestamps) && in_array("createdAt", $this->timestamps)) |
@@ -362,7 +361,7 @@ discard block |
||
| 362 | 361 | /** |
| 363 | 362 | * Delete method. Works only if object primaryKey is defined |
| 364 | 363 | * |
| 365 | - * @return boolean Indicates success. 0 or 1. |
|
| 364 | + * @return null|boolean Indicates success. 0 or 1. |
|
| 366 | 365 | */ |
| 367 | 366 | public function delete() { |
| 368 | 367 | if (empty ($this->data[$this->primaryKey])) |
@@ -522,7 +521,7 @@ discard block |
||
| 522 | 521 | * @param string $joinType SQL join type: LEFT, RIGHT, INNER, OUTER |
| 523 | 522 | * @param string $primaryKey SQL join On Second primaryKey |
| 524 | 523 | * |
| 525 | - * @return dbObject |
|
| 524 | + * @return Model |
|
| 526 | 525 | */ |
| 527 | 526 | private function join($objectName, $key = null, $joinType = 'LEFT', $primaryKey = null) { |
| 528 | 527 | $joinObj = new $objectName; |
@@ -571,7 +570,7 @@ discard block |
||
| 571 | 570 | /** |
| 572 | 571 | * Helper function to create dbObject with Json return type |
| 573 | 572 | * |
| 574 | - * @return dbObject |
|
| 573 | + * @return Model |
|
| 575 | 574 | */ |
| 576 | 575 | private function JsonBuilder() { |
| 577 | 576 | $this->returnType = 'Json'; |
@@ -585,7 +584,7 @@ discard block |
||
| 585 | 584 | /** |
| 586 | 585 | * Helper function to create dbObject with Array return type |
| 587 | 586 | * |
| 588 | - * @return dbObject |
|
| 587 | + * @return Model |
|
| 589 | 588 | */ |
| 590 | 589 | private function ArrayBuilder() { |
| 591 | 590 | $this->returnType = 'Array'; |
@@ -596,7 +595,7 @@ discard block |
||
| 596 | 595 | * Helper function to create dbObject with Object return type. |
| 597 | 596 | * Added for consistency. Works same way as new $objname () |
| 598 | 597 | * |
| 599 | - * @return dbObject |
|
| 598 | + * @return Model |
|
| 600 | 599 | */ |
| 601 | 600 | private function ObjectBuilder() { |
| 602 | 601 | $this->returnType = 'Object'; |
@@ -651,7 +650,7 @@ discard block |
||
| 651 | 650 | * @access public |
| 652 | 651 | * @param string $objectName Object Name |
| 653 | 652 | * |
| 654 | - * @return dbObject |
|
| 653 | + * @return null|Model |
|
| 655 | 654 | */ |
| 656 | 655 | private function with($objectName) { |
| 657 | 656 | if (!property_exists($this, 'relations') && !isset ($this->relations[$name])) |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * |
| 256 | 256 | * @param string $subQueryAlias |
| 257 | 257 | * |
| 258 | - * @return MysqliDb |
|
| 258 | + * @return Mysql |
|
| 259 | 259 | */ |
| 260 | 260 | public static function subQuery($subQueryAlias = "") { |
| 261 | 261 | return new self(array('host' => $subQueryAlias, 'isSubQuery' => true)); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | /** |
| 278 | 278 | * Helper function to create dbObject with JSON return type |
| 279 | 279 | * |
| 280 | - * @return MysqliDb |
|
| 280 | + * @return Mysql |
|
| 281 | 281 | */ |
| 282 | 282 | public function jsonBuilder() { |
| 283 | 283 | $this->returnType = 'json'; |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | /** |
| 288 | 288 | * Helper function to create dbObject with object return type. |
| 289 | 289 | * |
| 290 | - * @return MysqliDb |
|
| 290 | + * @return Mysql |
|
| 291 | 291 | */ |
| 292 | 292 | public function objectBuilder() { |
| 293 | 293 | $this->returnType = 'object'; |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | * Method attempts to prepare the SQL query |
| 351 | 351 | * and throws an error if there was a problem. |
| 352 | 352 | * |
| 353 | - * @return mysqli_stmt |
|
| 353 | + * @return \mysqli_stmt |
|
| 354 | 354 | */ |
| 355 | 355 | protected function _prepareQuery() { |
| 356 | 356 | if (!$stmt = $this->mysqli()->prepare($this->_query)) { |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | * This helper method takes care of prepared statements' "bind_result method |
| 540 | 540 | * , when the number of variables to pass is unknown. |
| 541 | 541 | * |
| 542 | - * @param mysqli_stmt $stmt Equal to the prepared statement object. |
|
| 542 | + * @param \mysqli_stmt $stmt Equal to the prepared statement object. |
|
| 543 | 543 | * |
| 544 | 544 | * @return array The results of the SQL fetch. |
| 545 | 545 | */ |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | * or only $count |
| 703 | 703 | * @param array $tableData Should contain an array of data for updating the database. |
| 704 | 704 | * |
| 705 | - * @return mysqli_stmt Returns the $stmt object. |
|
| 705 | + * @return null|\mysqli_stmt Returns the $stmt object. |
|
| 706 | 706 | */ |
| 707 | 707 | protected function _buildQuery($numRows = null, $tableData = null) { |
| 708 | 708 | // $this->_buildJoinOld(); |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | * |
| 1212 | 1212 | * @param string $tableName The name of the database table to work with. |
| 1213 | 1213 | * |
| 1214 | - * @return array Contains the returned rows from the select query. |
|
| 1214 | + * @return boolean Contains the returned rows from the select query. |
|
| 1215 | 1215 | */ |
| 1216 | 1216 | public function has($tableName) { |
| 1217 | 1217 | $this->getOne($tableName, '1'); |
@@ -1311,7 +1311,7 @@ discard block |
||
| 1311 | 1311 | * @param int|array $numRows Array to define SQL limit in format Array ($count, $offset) |
| 1312 | 1312 | * or only $count |
| 1313 | 1313 | * |
| 1314 | - * @return bool Indicates success. 0 or 1. |
|
| 1314 | + * @return null|boolean Indicates success. 0 or 1. |
|
| 1315 | 1315 | */ |
| 1316 | 1316 | public function delete($numRows = null) { |
| 1317 | 1317 | if ($this->isSubQuery) { |
@@ -1342,7 +1342,7 @@ discard block |
||
| 1342 | 1342 | * @param array $updateColumns Variable with values |
| 1343 | 1343 | * @param string $lastInsertId Variable value |
| 1344 | 1344 | * |
| 1345 | - * @return MysqliDb |
|
| 1345 | + * @return Mysql |
|
| 1346 | 1346 | */ |
| 1347 | 1347 | public function onDuplicate($updateColumns, $lastInsertId = null) { |
| 1348 | 1348 | $this->_lastInsertId = $lastInsertId; |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | * @param mixed $whereValue The value of the database field. |
| 1360 | 1360 | * @param string $operator Comparison operator. Default is = |
| 1361 | 1361 | * |
| 1362 | - * @return MysqliDb |
|
| 1362 | + * @return Mysql |
|
| 1363 | 1363 | */ |
| 1364 | 1364 | public function orWhere($whereProp, $whereValue = 'DBNULL', $operator = '=') { |
| 1365 | 1365 | return $this->where($whereProp, $whereValue, $operator, 'OR'); |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | * @param string $operator Comparison operator. Default is = |
| 1376 | 1376 | * @param string $cond Condition of where statement (OR, AND) |
| 1377 | 1377 | * |
| 1378 | - * @return MysqliDb |
|
| 1378 | + * @return Mysql |
|
| 1379 | 1379 | */ |
| 1380 | 1380 | public function where($whereProp, $whereValue = 'DBNULL', $operator = '=', $cond = 'AND') { |
| 1381 | 1381 | // forkaround for an old operation api |
@@ -1401,7 +1401,7 @@ discard block |
||
| 1401 | 1401 | * @param mixed $havingValue The value of the database field. |
| 1402 | 1402 | * @param string $operator Comparison operator. Default is = |
| 1403 | 1403 | * |
| 1404 | - * @return MysqliDb |
|
| 1404 | + * @return Mysql |
|
| 1405 | 1405 | */ |
| 1406 | 1406 | public function orHaving($havingProp, $havingValue = null, $operator = null) { |
| 1407 | 1407 | return $this->having($havingProp, $havingValue, $operator, 'OR'); |
@@ -1416,7 +1416,7 @@ discard block |
||
| 1416 | 1416 | * @param mixed $havingValue The value of the database field. |
| 1417 | 1417 | * @param string $operator Comparison operator. Default is = |
| 1418 | 1418 | * |
| 1419 | - * @return MysqliDb |
|
| 1419 | + * @return Mysql |
|
| 1420 | 1420 | */ |
| 1421 | 1421 | |
| 1422 | 1422 | public function having($havingProp, $havingValue = 'DBNULL', $operator = '=', $cond = 'AND') { |
@@ -1444,7 +1444,7 @@ discard block |
||
| 1444 | 1444 | * @param string $joinType 'LEFT', 'INNER' etc. |
| 1445 | 1445 | * |
| 1446 | 1446 | * @throws Exception |
| 1447 | - * @return MysqliDb |
|
| 1447 | + * @return Mysql |
|
| 1448 | 1448 | */ |
| 1449 | 1449 | public function join($joinTable, $joinCondition, $joinType = '') { |
| 1450 | 1450 | $allowedTypes = array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'); |
@@ -1529,7 +1529,7 @@ discard block |
||
| 1529 | 1529 | * This method does not escape strings by default so make sure you'll never use it in production. |
| 1530 | 1530 | * |
| 1531 | 1531 | * @author Jonas Barascu |
| 1532 | - * @param [[Type]] $query [[Description]] |
|
| 1532 | + * @param string $query [[Description]] |
|
| 1533 | 1533 | */ |
| 1534 | 1534 | private function queryUnprepared($query) { |
| 1535 | 1535 | // Execute query |
@@ -1603,11 +1603,11 @@ discard block |
||
| 1603 | 1603 | * @uses $MySqliDb->orderBy('id', 'desc')->orderBy('name', 'desc'); |
| 1604 | 1604 | * |
| 1605 | 1605 | * @param string $orderByField The name of the database field. |
| 1606 | - * @param string $orderByDirection Order direction. |
|
| 1606 | + * @param string $orderbyDirection Order direction. |
|
| 1607 | 1607 | * @param array $customFields Fieldset for ORDER BY FIELD() ordering |
| 1608 | 1608 | * |
| 1609 | 1609 | * @throws Exception |
| 1610 | - * @return MysqliDb |
|
| 1610 | + * @return Mysql |
|
| 1611 | 1611 | */ |
| 1612 | 1612 | public function orderBy($orderByField, $orderbyDirection = "DESC", $customFields = null) { |
| 1613 | 1613 | $allowedDirection = Array("ASC", "DESC"); |
@@ -1643,7 +1643,7 @@ discard block |
||
| 1643 | 1643 | * |
| 1644 | 1644 | * @param string $groupByField The name of the database field. |
| 1645 | 1645 | * |
| 1646 | - * @return MysqliDb |
|
| 1646 | + * @return Mysql |
|
| 1647 | 1647 | */ |
| 1648 | 1648 | public function groupBy($groupByField) { |
| 1649 | 1649 | $groupByField = preg_replace("/[^-a-z0-9\.\(\),_\*]+/i", '', $groupByField); |
@@ -1659,7 +1659,7 @@ discard block |
||
| 1659 | 1659 | * @param string $method The table lock method. Can be READ or WRITE. |
| 1660 | 1660 | * |
| 1661 | 1661 | * @throws Exception |
| 1662 | - * @return MysqliDb |
|
| 1662 | + * @return Mysql |
|
| 1663 | 1663 | */ |
| 1664 | 1664 | public function setLockMethod($method) { |
| 1665 | 1665 | // Switch the uppercase string |
@@ -1806,7 +1806,7 @@ discard block |
||
| 1806 | 1806 | * |
| 1807 | 1807 | * @param string $prefix Contains a tableprefix |
| 1808 | 1808 | * |
| 1809 | - * @return MysqliDb |
|
| 1809 | + * @return Mysql |
|
| 1810 | 1810 | */ |
| 1811 | 1811 | public function setPrefix($prefix = '') { |
| 1812 | 1812 | $this->prefix = $prefix; |
@@ -2016,7 +2016,7 @@ discard block |
||
| 2016 | 2016 | * @param bool $enabled Enable execution time tracking |
| 2017 | 2017 | * @param string $stripPrefix Prefix to strip from the path in exec log |
| 2018 | 2018 | * |
| 2019 | - * @return MysqliDb |
|
| 2019 | + * @return Mysql |
|
| 2020 | 2020 | */ |
| 2021 | 2021 | public function setTrace($enabled, $stripPrefix = null) { |
| 2022 | 2022 | $this->traceEnabled = $enabled; |
@@ -2053,7 +2053,7 @@ discard block |
||
| 2053 | 2053 | * |
| 2054 | 2054 | * @param string $idField field name to use for a mapped element key |
| 2055 | 2055 | * |
| 2056 | - * @return MysqliDb |
|
| 2056 | + * @return Mysql |
|
| 2057 | 2057 | */ |
| 2058 | 2058 | public function map($idField) { |
| 2059 | 2059 | $this->_mapKey = $idField; |
@@ -2069,7 +2069,7 @@ discard block |
||
| 2069 | 2069 | * @param string $whereProp The name of the database field. |
| 2070 | 2070 | * @param mixed $whereValue The value of the database field. |
| 2071 | 2071 | * |
| 2072 | - * @return dbWrapper |
|
| 2072 | + * @return Mysql |
|
| 2073 | 2073 | */ |
| 2074 | 2074 | public function joinOrWhere($whereJoin, $whereProp, $whereValue = 'DBNULL', $operator = '=', $cond = 'AND') { |
| 2075 | 2075 | return $this->joinWhere($whereJoin, $whereProp, $whereValue, $operator, 'OR'); |
@@ -2084,7 +2084,7 @@ discard block |
||
| 2084 | 2084 | * @param string $whereProp The name of the database field. |
| 2085 | 2085 | * @param mixed $whereValue The value of the database field. |
| 2086 | 2086 | * |
| 2087 | - * @return dbWrapper |
|
| 2087 | + * @return Mysql |
|
| 2088 | 2088 | */ |
| 2089 | 2089 | public function joinWhere($whereJoin, $whereProp, $whereValue = 'DBNULL', $operator = '=', $cond = 'AND') { |
| 2090 | 2090 | $this->_joinAnd[$whereJoin][] = Array($cond, $whereProp, $operator, $whereValue); |
@@ -2160,7 +2160,7 @@ discard block |
||
| 2160 | 2160 | * Helper function to create dbObject with array return type |
| 2161 | 2161 | * Added for consistency as thats default output type |
| 2162 | 2162 | * |
| 2163 | - * @return MysqliDb |
|
| 2163 | + * @return Mysql |
|
| 2164 | 2164 | */ |
| 2165 | 2165 | public function arrayBuilder() { |
| 2166 | 2166 | $this->returnType = 'array'; |
@@ -2241,7 +2241,7 @@ discard block |
||
| 2241 | 2241 | /** |
| 2242 | 2242 | * Function to enable SQL_CALC_FOUND_ROWS in the get queries |
| 2243 | 2243 | * |
| 2244 | - * @return MysqliDb |
|
| 2244 | + * @return Mysql |
|
| 2245 | 2245 | */ |
| 2246 | 2246 | public function withTotalCount() { |
| 2247 | 2247 | $this->setQueryOption('SQL_CALC_FOUND_ROWS'); |
@@ -2253,10 +2253,10 @@ discard block |
||
| 2253 | 2253 | * |
| 2254 | 2254 | * @uses $MySqliDb->setQueryOption('name'); |
| 2255 | 2255 | * |
| 2256 | - * @param string|array $options The optons name of the query. |
|
| 2256 | + * @param string $options The optons name of the query. |
|
| 2257 | 2257 | * |
| 2258 | 2258 | * @throws Exception |
| 2259 | - * @return MysqliDb |
|
| 2259 | + * @return Mysql |
|
| 2260 | 2260 | */ |
| 2261 | 2261 | public function setQueryOption($options) { |
| 2262 | 2262 | $allowedOptions = Array('ALL', 'DISTINCT', 'DISTINCTROW', 'HIGH_PRIORITY', 'STRAIGHT_JOIN', 'SQL_SMALL_RESULT', |