| 1 | <?php |
||
| 15 | trait DatabaseTrait |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var \CI_DB |
||
| 19 | */ |
||
| 20 | protected $db; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var \CI_DB_result |
||
| 24 | */ |
||
| 25 | protected $query; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Parses the table name from Describe class. |
||
| 29 | * |
||
| 30 | * @param string $table |
||
| 31 | * @param boolean $isForeignKey |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | 36 | protected function getClassTableName($table, $isForeignKey = false) |
|
| 35 | { |
||
| 36 | 36 | $tableName = $table; |
|
| 37 | |||
| 38 | 36 | if (! $isForeignKey && $this->table) { |
|
| 39 | 24 | $tableName = $this->table; |
|
| 40 | |||
| 41 | 24 | if (is_object($this->table)) { |
|
| 42 | 9 | $tableName = $this->table->getTableName(); |
|
| 43 | 9 | } |
|
| 44 | 24 | } |
|
| 45 | |||
| 46 | 36 | $tableName = ucfirst(singular($tableName)); |
|
| 47 | 36 | $tableNames = explode('.', $tableName); |
|
| 48 | |||
| 49 | 36 | return isset($tableNames[1]) ? $tableNames[1] : $tableName; |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Sets the database class. |
||
| 54 | * |
||
| 55 | * @param \CI_DB|null $database |
||
| 56 | * @return self |
||
| 57 | */ |
||
| 58 | 39 | public function setDatabase($database = null) |
|
| 76 | |||
| 77 | /** |
||
| 78 | * Sets the query result. |
||
| 79 | * |
||
| 80 | * @param \CI_DB_result $query |
||
| 81 | * @return self |
||
| 82 | */ |
||
| 83 | 3 | public function setQuery($query) |
|
| 89 | } |
||
| 90 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.