public function save($updateIndex = false)
    {
        $this->clearCacheTableIndex();
        if ($this->exists()) {
            return $this->update();
        }
        $result = $this->insert();
        if ($result && $updateIndex) {
            $this->setToIndex($result);
        }

        return $result;
    }
public function save($updateIndex = false)
    {
        $this->clearCacheTableIndex();
        if ($this->exists()) {
            return $this->update();
        }
        $result = $this->insert();
        if ($result && $updateIndex) {
            $this->setToIndex($result);
        }

        return $result;
    }
public function save ( $ updateIndex = false ) { $ this -> clearCacheTableIndex ( ) ; if ( $ this -> exists ( ) ) { return $ this -> update ( ) ; } $ result = $ this -> insert ( ) ; if ( $ result && $ updateIndex ) { $ this -> setToIndex ( $ result ) ; } return $ result ; }
Actualiza si ya existe, en otro caso inserta

@param bool $updateIndex
@return bool
Actualiza si ya existe en otro caso inserta