/** * afterDelete callback * * @param Model $Model Model using this behavior * @return boolean */ public function beforeDelete(Model $Model, $cascade = true) { $tag_collection_id = $Model->field(self::TAG_FOREIGN_KEY); if (isset($tag_collection_id)) { $this->TagCollection->decrementInstances($tag_collection_id); } }