/** * Executes before the event is created. * * @author Jason Rey <*****@*****.**> * @since 1.3 * @access public * @param array $post The posted data. * @param SocialCluster $cluster The cluster object. */ public function onEditBeforeSave(&$post, &$cluster) { if ($cluster->isGroupEvent()) { // Currently, the type always follow group type // There is a separate checking where user must be group member to join the event $cluster->type = FD::group($cluster->getMeta('group_id'))->type; unset($post['event_type']); return; } $type = isset($post['event_type']) ? $post['event_type'] : $cluster->type; $cluster->type = $type; unset($post['event_type']); }