public function addUnique($unique)
    {
        if ($unique instanceof Unique) {
            $unique->setTable($this);
            $unique->getName(); // we call this method so that the name is created now if it doesn't already exist.
            $this->unices[] = $unique;

            return $unique;
        }

        $unik = new Unique();
        $unik->loadMapping($unique);

        return $this->addUnique($unik);
    }
public function addUnique($unique)
    {
        if ($unique instanceof Unique) {
            $unique->setTable($this);
            $unique->getName(); // we call this method so that the name is created now if it doesn't already exist.
            $this->unices[] = $unique;

            return $unique;
        }

        $unik = new Unique();
        $unik->loadMapping($unique);

        return $this->addUnique($unik);
    }
public function addUnique ( $ unique ) { if ( $ unique instanceof Unique ) { $ unique -> setTable ( $ this ) ; $ unique -> getName ( ) ; // we call this method so that the name is created now if it doesn't already exist. $ this -> unices [ ] = $ unique ; return $ unique ; } $ unik = new Unique ( ) ; $ unik -> loadMapping ( $ unique ) ; return $ this -> addUnique ( $ unik ) ; }
Adds a new Unique index to the list of unique indices and set the
parent table of the column to the current table.

@param  Unique|array $unique
@return Unique
Adds a new Unique index to the list of unique indices and set the parent table of the column to the current table .