@@ 165-177 (lines=13) @@ | ||
162 | * |
|
163 | * @return bool |
|
164 | */ |
|
165 | public function save($dbConnection = NULL) |
|
166 | { |
|
167 | $connection = DatabaseQuery::checkConnection($dbConnection); |
|
168 | ||
169 | $query = $this->insertQuery(self::getTableName($connection)); |
|
170 | $statement = $connection->prepare($query); |
|
171 | if( $statement->execute() ) |
|
172 | { |
|
173 | return true; |
|
174 | } |
|
175 | throw new DataAlreadyExistException(); |
|
176 | ||
177 | } |
|
178 | ||
179 | /** |
|
180 | * update() |
|
@@ 185-196 (lines=12) @@ | ||
182 | * |
|
183 | * @return bool |
|
184 | */ |
|
185 | public function update($dbConnection = NULL) |
|
186 | { |
|
187 | $connection = DatabaseQuery::checkConnection($dbConnection); |
|
188 | ||
189 | $updateQuery = $this->updateQuery(self::getTableName($connection)); |
|
190 | $statement = $connection->prepare($updateQuery); |
|
191 | if( $statement->execute() ) |
|
192 | { |
|
193 | return true; |
|
194 | } |
|
195 | throw new DataAlreadyExistException(); |
|
196 | } |
|
197 | ||
198 | /** |
|
199 | * destroy($value) |