public function beforeSave($insert)
    {
        $eventName = $insert ? self::EVENT_BEFORE_INSERT : self::EVENT_BEFORE_UPDATE;
        $isValid = true;
        $this->emit($eventName, [&$this, &$isValid]);

        return $isValid;
    }