Esempio n. 1
0
 public function save(PropelPDO $con = null)
 {
     $query = DomainQuery::create()->filterByName($this->getName());
     if ($this->getId()) {
         $query->add(DomainPeer::ID, $this->getId(), Criteria::NOT_EQUAL);
     }
     if (!$this->getAccountId()) {
         throw new Exception('A Domain must belong to an Account.');
     }
     if ($query->findOneByAccountId($this->getAccountId())) {
         throw new Exception('A Domain must have a unique name.', self::ERROR_NOT_UNIQUE);
     }
     return parent::save($con);
 }
Esempio n. 2
0
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new DomainPeer();
     }
     return self::$peer;
 }