__construct() публичный Метод

public __construct ( $values = null )
Пример #1
0
 /**
  * @param array $columns
  */
 public function __construct(array $columns)
 {
     parent::__construct($columns);
     foreach ($columns as $key) {
         $name = str_replace('_', ' ', $key);
         $name = ucfirst($name);
         $this->setValue($key, $name);
     }
 }
 /**
  * Constructor
  * @param array                   $row     Array of data
  * @param DataAccessObjectFactory $factory
  */
 public function __construct(array $row = null, DataAccessObjectFactory $factory = null)
 {
     if ($row == null) {
         $row = static::getDefaultRow();
         $this->isNewObject = true;
     } elseif (!array_key_exists(static::getIdField(), $row)) {
         $row[static::getIdField()] = null;
         $this->isNewObject = true;
     }
     if ($this->isNewObject()) {
         foreach (array_keys($row) as $field) {
             if (in_array($field, static::getFields())) {
                 $this->addModifiedColumn($field);
             }
         }
     }
     $this->factory = static::ifNullReturnNewFactory($factory);
     parent::__construct($row);
 }
Пример #3
0
 public function __construct($name, array $row)
 {
     parent::__construct($row);
     $this->name = $name;
 }