$property; } else { trigger_error('ADFO_list_setting: GET '.$property. " NOT EXISTS ", E_USER_WARNING); } } public function __set($property, $value) { if (property_exists($this, $property)) { $this->$property = $value; }else { /* trigger_error('ADFO_list_setting: GET '.$property. " NOT EXISTS ", E_USER_WARNING); */ } return $this; } /** * la funzione isset del php nelle variabili delle classi non può essere usato. * @param String $property */ public function isset($property) { return (property_exists($this, $property) && $this->$property != null && $this->$property != ''); } /** * Setta le variabili a partire da un array *```php * (new ADFO_list_setting())->set_from_array($vars); *``` * @param array $array * @return \ADFO_list_setting */ public function set_from_array($array) { foreach ($array as $key=>$value) { $this->$key = $value; } return $this; } /** * Ritorna l'array per il salvataggio nel db * * @return array */ public function get_for_saving_in_the_db() { $vars = get_object_vars($this); unset($vars['def']); unset($vars['db']); unset($vars['catalog']); unset($vars['max_length']); unset($vars['length']); unset($vars['charsetnr']); unset($vars['flags']); unset($vars['decimals']); if ($vars['view'] != 'LOOKUP') { unset($vars['lookup_id']); unset($vars['lookup_sel_val']); unset($vars['lookup_sel_txt']); } return $vars; } public function get_array() { $vars = get_object_vars($this); if ($vars['view'] != 'LOOKUP') { unset($vars['lookup_id']); unset($vars['lookup_sel_val']); unset($vars['lookup_sel_txt']); } return $vars; } } /** * dbpDs_list_delete La struttura per la rimozione di un campo * Qui si può aprire un mondo sulle condizioni per poter cancellare un campo, * eventuali tabelle collegate ecc... */ class DbpDs_list_delete_params extends ADFO_data_structures { /** @var string $allow Se da questa view è permesso cancellare un record */ public $allow; /** @var array $remove_tables_alias Se l'elenco delle tabelle che è ammesso rimuovere */ public $remove_tables_alias = []; /** @var string $field_title Il campo da mostrare quando si chiede la conferma di rimozione */ //public $field_title; /** @var string $soft_delete Il campo che gestisce il soft delete */ //public $soft_delete_field; /** @var string $soft_delete Il campo che gestisce il soft delete */ //public $soft_delete_value; /** @var string %sql_allow La query di preparazione per verificare se un campo si può rimuovere ? */ public function __construct($array = ""){ if (is_array($array)) { $this->set_from_array($array); } if (is_object($array)) { $this->set_from_array((array)$array); } $this->allow = false; if (is_array($this->remove_tables_alias) && count($this->remove_tables_alias) > 0 ) { foreach ($this->remove_tables_alias as $value) { if ($value == 1) { $this->allow = true; } } } else { // se non impostato $this->allow = true; } } }