/** * @inheritdoc */ public function formSettings($name, $settings = []) { $settings = parent::formSettings($name, $settings); if (!array_key_exists('title', $settings)) { $settings['title'] = false; } $settings['fields'] = []; $settings['fields'][] = ['email_address']; if (!$this->isNewRecord) { $settings['fields'][] = ['no_mailings']; } return $settings; }
/** * @inheritdoc */ public function beforeValidate() { $originalPhone = $this->phone; $originalExtension = $this->extension; $phone = preg_replace('/[^0-9a-zA-Z]/', '', $originalPhone); preg_match('/([0-9]+)([a-zA-Z]*)([0-9]*)/', $phone, $matches); $this->phone = isset($matches[1]) ? $matches[1] : null; if (empty($originalExtension) || isset($matches[3]) && $originalExtension === $matches[3]) { $this->extension = isset($matches[3]) ? $matches[3] : null; } else { unset($matches[0]); $this->phone = trim(implode(' ', $matches)); } if (empty($this->phone)) { $this->phone = null; } if (empty($this->extension)) { $this->extension = null; } return parent::beforeValidate(); }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), []); }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), ['Storage' => ['class' => 'cascade\\components\\storageHandlers\\StorageBehavior']]); }
/** * @inheritdoc */ public function formSettings($name, $settings = []) { return parent::formSettings($name, $settings); }
/** * @inheritdoc */ public function additionalFields() { return array_merge(parent::additionalFields(), ['parent:Individual::primary_staff' => 'parent:Individual', 'parent:Account::contractee' => 'parent:Account', 'parent:Account::contractor' => 'parent:Account']); }
/** * @inheritdoc */ public function additionalFields() { return array_merge(parent::additionalFields(), ['completedStatus' => [], 'parent:Individual::contributor' => 'parent:Individual', 'parent:Individual::requestor' => 'parent:Individual']); }
/** * @inheritdoc */ public static function searchFields() { $fields = parent::searchFields(); $fields[] = 'alt_name'; return $fields; }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), ['Photo' => 'cascade\\components\\db\\behaviors\\Photo']); }