Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Feature/5.0 dao #56

Closed
wants to merge 9 commits into from
This page is out of date. Refresh to see the latest.
View
18 classes/automodeler/core.php
@@ -545,20 +545,4 @@ public function offsetUnset($key)
{
$this->_data[$key] = NULL;
}
-}
-
-class AutoModeler_Exception extends Kohana_Exception
-{
- public $errors;
-
- public function __construct($title, array $message = NULL, $errors = '')
- {
- parent::__construct($title, $message);
- $this->errors = $errors;
- }
-
- public function __toString()
- {
- return $this->message;
- }
-}
+}
View
15 classes/automodeler/dao/database.php
@@ -8,8 +8,8 @@
* @copyright (c) 2012 Jeremy Bush
* @license http://www.opensource.org/licenses/isc-license.txt
*/
-class AutoModeler_DAO_Database
-{
+class AutoModeler_DAO_Database {
+
protected $_table_name;
protected $_lang = 'form_errors';
@@ -56,8 +56,9 @@ public function table_name()
* Saves a model object to the data store
*
* @param AutoModeler_Model $model the model to save
- * @param Database_Query_Builder_Insert $qb a qb object for mocking
- *
+ * @param Database_Query_Builder_Insert|null $qb a qb object for mocking
+ * @return AutoModeler_Model
+ * @throws AutoModeler_Exception
*/
public function create(AutoModeler_Model $model, Database_Query_Builder_Insert $qb = NULL)
{
@@ -89,8 +90,8 @@ public function create(AutoModeler_Model $model, Database_Query_Builder_Insert $
*
* @param AutoModeler_Model $model the model to save
* @param Database_Query_Builder_Update $qb optional qb object for mocks
- *
- * @return the count of how many rows were updated
+ * @return int the count of how many rows were updated
+ * @throws AutoModeler_Exception
*/
public function update(AutoModeler_Model $model, Database_Query_Builder_Update $qb = NULL)
{
@@ -119,6 +120,8 @@ public function update(AutoModeler_Model $model, Database_Query_Builder_Update $
*
* @param AutoModeler_Model $model the model to delete
* @param Database_Query_Builder_Delete $qb optional qb object for mocking
+ * @return AutoModeler_Model
+ * @throws AutoModeler_Exception
*/
public function delete(AutoModeler_Model $model, Database_Query_Builder_delete $qb = NULL)
{
View
15 classes/automodeler/exception.php
@@ -1,6 +1,17 @@
<?php
-class AutoModeler_Exception extends Exception
+class AutoModeler_Exception extends Kohana_Exception
{
+ public $errors;
-}
+ public function __construct($title, array $message = NULL, $errors = '')
+ {
+ parent::__construct($title, $message);
+ $this->errors = $errors;
+ }
+
+ public function __toString()
+ {
+ return $this->message;
+ }
+}
Something went wrong with that request. Please try again.