This commit is contained in:
Paula V. Quispe
2016-07-26 15:20:31 -04:00
parent 057bdbe356
commit 403387c14d
3 changed files with 79 additions and 30 deletions

View File

@@ -458,4 +458,47 @@ class AddonsManager extends BaseAddonsManager
}
return true;
}
/**
* Exists in Addons Manager Table
*
* @param string $addonId
* @param string $storeId
* @return type
* @throws type
*/
public function exists($addonId, $storeId)
{
$oAddManager = AddonsManagerPeer::retrieveByPK($addonId, $storeId);
return (!is_null($oAddManager));
}
/**
* Update Addons Manager Table
*
* @param type $data
* @return type
* @throws type
*/
public function update($data)
{
$con = Propel::getConnection( AddonsManagerPeer::DATABASE_NAME );
try {
$con->begin();
$this->setNew( false );
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
if ($this->validate()) {
$result = $this->save();
$con->commit();
return $result;
} else {
$con->rollback();
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
}
} catch (Exception $e) {
$con->rollback();
throw ($e);
}
}
}