/** * Create field object for grid * @param array $fieldFieldConfig config of this particular field * @param $wholeConfig whole grid setup config * @throws \Ip\Exception */ public function __construct($fieldFieldConfig, $wholeConfig) { if (!empty($fieldFieldConfig['html'])) { $this->html = $fieldFieldConfig['html']; } return parent::__construct($fieldFieldConfig, $wholeConfig); }
/** * Create field object for grid * @param array $config config of this particular field * @param $wholeConfig whole grid setup config * @throws \Ip\Exception */ public function __construct($fieldConfig, $wholeConfig) { $this->parentField = 'id'; if (empty($fieldConfig['gridId'])) { throw new \Ip\Exception('Grid field needs \'gridId\' - a unique identificator of a subgrid.'); } $this->gridId = $fieldConfig['gridId']; if (empty($fieldConfig['config'])) { throw new \Ip\Exception('Grid field needs \'config\' setting to be set.'); } $this->config = $fieldConfig['config']; return parent::__construct($fieldConfig, $wholeConfig); }
/** * Create field object for grid * @param array $fieldFieldConfig config of this particular field * @param $wholeConfig whole grid setup config * @throws \Ip\Exception */ public function __construct($fieldFieldConfig, $wholeConfig) { if (!empty($fieldFieldConfig['currency'])) { $this->currency = $fieldFieldConfig['currency']; } else { $this->currency = 'USD'; } if (!empty($fieldFieldConfig['currencyField'])) { $this->currencyField = $fieldFieldConfig['currencyField']; } if (!empty($fieldFieldConfig['defaultValue'])) { $fieldFieldConfig['defaultValue'] = $fieldFieldConfig['defaultValue'] / 100; } return parent::__construct($fieldFieldConfig, $wholeConfig); }
public function __construct($fieldFieldConfig, $wholeConfig) { parent::__construct($fieldFieldConfig, $wholeConfig); if (!empty($fieldFieldConfig['repositoryBindKey'])) { $this->repositoryBindKey = $fieldFieldConfig['repositoryBindKey']; } else { $this->repositoryBindKey = 'Table_' . $wholeConfig['table'] . '_' . $this->field; } if (array_key_exists('fileLimit', $fieldFieldConfig)) { $this->fileLimit = $fieldFieldConfig['fileLimit']; } else { $this->fileLimit = 1; } if (!empty($this->defaultValue) && !is_array($this->defaultValue)) { $this->defaultValue = array($this->defaultValue); } }