src/AbstractModel.php
public function unique($criteria = null, array $values = array())
    {
        if (!$this->_properties['primary_key'] || (!$values && !$criteria))
            throw new Exception(sprintf(self::E_PrimaryKey, get_called_class()), 1);

        $that = clone $this;
        $values ? $that->find($criteria, $values) : $that->findByPK($criteria);

        return ($that->dry() || $this->pkCompare($that->pkValue()));
    }
public function unique($criteria = null, array $values = array())
    {
        if (!$this->_properties['primary_key'] || (!$values && !$criteria))
            throw new Exception(sprintf(self::E_PrimaryKey, get_called_class()), 1);

        $that = clone $this;
        $values ? $that->find($criteria, $values) : $that->findByPK($criteria);

        return ($that->dry() || $this->pkCompare($that->pkValue()));
    }
public function unique ( $ criteria = null , array $ values = array ( ) ) { if ( ! $ this -> _properties [ 'primary_key' ] || ( ! $ values && ! $ criteria ) ) throw new Exception ( sprintf ( self :: E_PrimaryKey , get_called_class ( ) ) , 1 ) ; $ that = clone $ this ; $ values ? $ that -> find ( $ criteria , $ values ) : $ that -> findByPK ( $ criteria ) ; return ( $ that -> dry ( ) || $ this -> pkCompare ( $ that -> pkValue ( ) ) ) ; }
Check not existance
Check not existance