コード例 #1
0
 /**
  * @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;
 }
コード例 #2
0
 /**
  * @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();
 }
コード例 #3
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), []);
 }
コード例 #4
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), ['Storage' => ['class' => 'cascade\\components\\storageHandlers\\StorageBehavior']]);
 }
コード例 #5
0
 /**
  * @inheritdoc
  */
 public function formSettings($name, $settings = [])
 {
     return parent::formSettings($name, $settings);
 }
コード例 #6
0
 /**
  * @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']);
 }
コード例 #7
0
 /**
  * @inheritdoc
  */
 public function additionalFields()
 {
     return array_merge(parent::additionalFields(), ['completedStatus' => [], 'parent:Individual::contributor' => 'parent:Individual', 'parent:Individual::requestor' => 'parent:Individual']);
 }
コード例 #8
0
 /**
  * @inheritdoc
  */
 public static function searchFields()
 {
     $fields = parent::searchFields();
     $fields[] = 'alt_name';
     return $fields;
 }
コード例 #9
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), ['Photo' => 'cascade\\components\\db\\behaviors\\Photo']);
 }