Taxonomy::beforeSave PHP Method

beforeSave() protected method

protected beforeSave ( )
    protected function beforeSave()
    {
        if (parent::beforeSave()) {
            if ($this->isNewRecord) {
                if ($this->guid == '') {
                    $this->guid = uniqid();
                }
            }
            return true;
        } else {
            return false;
        }
    }

Usage Example

Example #1
0
 public function beforeSave()
 {
     $this->type = "tag";
     return parent::beforeSave();
 }