/** * Send need approval email if we need it. * * @param boolean $created * @return boolean */ public function afterSave($created, $options = array()) { if ($created) { //Maybe URI } if (isset($this->data[$this->alias]['is_approved']) && !$this->data[$this->alias]['is_approved']) { //Email IT about needing approval... currently me. $this->sendNotification(); } return parent::afterSave($created, $options); }
/** * Assign or create the url. * * @return boolean */ public function beforeSave($options = array()) { $this->createOrSetUri(); return parent::beforeSave($options); }
/** * Load the settings */ function __construct($id = false, $table = null, $ds = null) { parent::__construct($id, $table, $ds); $this->settings = SeoUtil::getConfig('levenshtein'); }
/** * Given a request, see if the uri matches. * @param string request * @param mixed string uri or uri_id to look up * @return boolean if request matches the URI given */ public function requestMatch($request, $uri = null) { if (preg_match('/^([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/', $uri)) { $uri = $this->field('uri', array('SeoUri.id' => $uri)); } return parent::requestMatch($request, $uri); }