protected function add(ModelObject $obj)
    {
        // Check that all required fields exist.
        $this->getErrors()->validateModelObject($obj);

        if ($this->dao->slugExists($obj->Slug))
            $this->errors->reject("The slug for this ".get_class($obj)." record is already in use.");
    }
protected function add(ModelObject $obj)
    {
        // Check that all required fields exist.
        $this->getErrors()->validateModelObject($obj);

        if ($this->dao->slugExists($obj->Slug))
            $this->errors->reject("The slug for this ".get_class($obj)." record is already in use.");
    }
protected function add ( ModelObject $ obj ) { // Check that all required fields exist. $ this -> getErrors ( ) -> validateModelObject ( $ obj ) ; if ( $ this -> dao -> slugExists ( $ obj -> Slug ) ) $ this -> errors -> reject ( "The slug for this " . get_class ( $ obj ) . " record is already in use." ) ; }
Validates the model object and ensures that slug doesn't exist anywhere.

@param ModelObject $obj The object to validate

@return void
Validates the model object and ensures that slug doesn t exist anywhere .