Phalcon\Mvc\Model\MetaData\Base::__construct PHP Method

__construct() public method

Class constructor.
public __construct ( null | array $options = null )
$options null | array
    public function __construct($options = null)
    {
        if (is_array($options)) {
            if (!isset($options['lifetime'])) {
                $options['lifetime'] = self::$defaults['lifetime'];
            }
            if (!isset($options['prefix'])) {
                $options['prefix'] = self::$defaults['prefix'];
            }
        }
        $this->options = $options;
    }

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  *
  * @param  null|array                   $options
  * @throws \Phalcon\Mvc\Model\Exception
  */
 public function __construct($options = null)
 {
     if (!is_array($options)) {
         throw new Exception('No configuration given');
     }
     if (!isset($options['redis'])) {
         throw new Exception('Parameter "redis" is required');
     }
     parent::__construct($options);
 }
All Usage Examples Of Phalcon\Mvc\Model\MetaData\Base::__construct