fix test suite

This commit is contained in:
Manuel Raynaud
2013-09-12 17:28:02 +02:00
parent 0ca5af597a
commit bad8a0439d
3 changed files with 52 additions and 10 deletions

View File

@@ -58,6 +58,10 @@ class Address extends BaseAddress {
*/
public function preDelete(ConnectionInterface $con = null)
{
if($this->getIsDefault()) {
return false;
}
$this->dispatchEvent(TheliaEvents::BEFORE_DELETEADDRESS, new AddressEvent($this));
return true;
}
@@ -71,14 +75,4 @@ class Address extends BaseAddress {
$this->dispatchEvent(TheliaEvents::AFTER_DELETEADDRESS, new AddressEvent($this));
}
public function preSave()
{
$valid = true;
if($this->getIsDefault()) {
$valid = false;
}
return $valid;
}
}