Пример #1
0
 /**
  * @param string $name
  * @param string $label
  * @param int $value
  * @param bool $showOnForm
  * @param bool $showOnList
  * @param int $min [optional]
  * @param int $max [optional]
  */
 function __construct($name, $label, $value, $showOnForm, $showOnList, $min = -1, $max = -1)
 {
     parent::__construct($name, $name, BasicProperty::INTEGER, $label, $showOnForm, $showOnList);
     $this->value = intval($value);
     $this->min = $min;
     $this->max = $max;
 }
Пример #2
0
 /**
  * @param string $name
  * @param string $label
  * @param int $value
  * @param BasicEntity[] $entityInstances - NOT EMPTY
  * @param bool $showOnForm
  * @param bool $showOnList [optional]
  * @param bool|BasicEntity $entityInstance [optional]
  */
 function __construct($name, $label, $value, $entityInstances, $showOnForm, $showOnList = false, $entityInstance = false)
 {
     parent::__construct($name, $name, BasicProperty::ENTITY, $label, $showOnForm, $showOnList);
     $this->value = $value;
     $this->entityInstances = $entityInstances;
     $this->entityInstance = $entityInstance;
 }
Пример #3
0
 /**
  * @param string $name
  * @param string $label
  * @param string $value
  * @param bool $showOnForm
  * @param bool $showOnList
  */
 function __construct($name, $label, $value, $showOnForm, $showOnList)
 {
     parent::__construct($name, $name, BasicProperty::DATE, $label, $showOnForm, $showOnList);
     if ($value) {
         $value = str_replace('/', '-', $value);
         $this->value = date(self::MY_SQL_DATE_FORMAT, strtotime($value));
     } else {
         $this->value = date(self::MY_SQL_DATE_FORMAT, time());
     }
 }
Пример #4
0
 /**
  * @param string $name
  * @param string $label
  * @param array $params
  * @param string $paramName
  * @param bool $showOnForm
  * @param bool $showOnList
  */
 function __construct($name, $label, $params, $paramName, $showOnForm, $showOnList)
 {
     parent::__construct($name, $name, BasicProperty::BOOLEAN, $label, $showOnForm, $showOnList);
     $value = false;
     if (isset($params[$paramName])) {
         if (strcmp($params[$paramName], 'on') === 0 || $params[$paramName] == 1) {
             $value = true;
         }
     }
     $this->value = $value ? '1' : '0';
 }
Пример #5
0
 /**
  * @param string $name
  * @param string $label
  * @param string $value
  * @param bool $showOnForm
  * @param bool $showOnList
  */
 function __construct($name, $label, $value, $showOnForm, $showOnList)
 {
     parent::__construct($name, $name, BasicProperty::STRING, $label, $showOnForm, $showOnList);
     $this->value = $value;
 }