Example #1
0
 public function __construct($data)
 {
     parent::__construct($data);
     $this->_dataStore = $this->data = $data;
     $this->pages = 1;
     $this->perPage = count($this->_dataStore);
 }
Example #2
0
 /**
  * @param array $elements
  * @param int $currentPage
  * @param int $count
  * @param int $pageSize
  */
 public function __construct(array $elements, int $currentPage, int $count = null, $pageSize = 20)
 {
     parent::__construct($elements);
     $this->currentPage = $currentPage;
     $this->count = $count;
     $this->pageSize = $pageSize;
 }
Example #3
0
 /**
  * Constructor
  *
  * @param array $points An array of at least two points with
  * which to build the LineString
  */
 public function __construct($points = array())
 {
     if (count($points) == 1) {
         throw new Exception("Cannot construct a LineString with a single point");
     }
     // Call the Collection constructor to build the LineString
     parent::__construct($points);
 }
 public function __construct()
 {
     parent::__construct();
     foreach ($this->types as $type_id => $class_name) {
         $item = $this->create_item($type_id);
         $this->members[$type_id] = $item;
     }
 }
Example #5
0
 public function __construct($data = null)
 {
     if (null !== $data && is_string($data)) {
         $this->fromString($data);
     } else {
         parent::__construct($data);
     }
 }
 /**
  * Constructor
  *
  * The first linestring is the outer ring
  * The subsequent ones are holes
  * All linestrings should be a closed LineString
  *
  * @param array $linestrings The LineString array
  */
 public function __construct(array $linestrings)
 {
     if (count($linestrings) > 0) {
         parent::__construct($linestrings);
     } else {
         throw new Exception("Polygon without an exterior ring");
     }
 }
 /**
  * Constructor
  *
  * @param array $positions The Point array
  */
 public function __construct(array $positions)
 {
     if (count($positions) > 1) {
         parent::__construct($positions);
     } else {
         throw new Exception("Linestring with less than two points");
     }
 }
Example #8
0
 /**
  * @param Route $route a Route thru which the IWebContext was passed
  * @param IRouteTable $routeTable table of routes that was looked up to find the appropriate Route
  * @param IWebContext $webContext context that was passed thru the Route
  * @param Trace $parentTrace inital Trace which's handling failed cascading usage of a fallback Route
  */
 function __construct(Route $route, IRouteTable $routeTable, IWebContext $webContext, Trace $parentTrace = null)
 {
     $this->route = $route;
     $this->routeTable = $routeTable;
     $this->webContext = $webContext;
     $this->parentTrace = $parentTrace;
     parent::__construct();
 }
Example #9
0
 public function __construct($data = array())
 {
     $newData = [];
     foreach ($data as $item) {
         $newData[] = new TodoItem($item);
     }
     parent::__construct($newData);
 }
Example #10
0
 public function __construct($refresh = false, $callback = null)
 {
     parent::__construct($this->repository);
     $this->fetch($refresh, $callback);
     $this->data = json_decode($this->raw);
     foreach ($this->data as $slug => $data) {
         $this->items[$slug] = new Package($data, $this->type);
     }
 }
Example #11
0
 function __construct($id, $scheme, $table, $fields = "*", $from = "", $where = "", $limit_size = 30)
 {
     $sql = "SELECT * FROM `{$table}` WHERE `id` = {$id}";
     //		dbg($sql);
     $this->v = $this->queryRow($sql);
     //		dbg($this->v);
     $this->scheme = $scheme;
     parent::__construct($table, $fields = "*", $from = "", $where = "", $limit_size);
 }
Example #12
0
 /**
  * Class construct
  * @param array|\ArrayObject|null $array
  * @return void
  */
 public function __construct($array = null, array $options = null)
 {
     $options = array_merge(null === $options ? array() : $options, array('indexType' => static::INDEX_ASSOCIATIVE, 'readonly' => false));
     if (array_key_exists('name', $options)) {
         $this->setName($options['name']);
     }
     parent::__construct($array, $options);
     $this->setFlags(self::ARRAY_AS_PROPS);
 }
 /**
  * Constructor
  *
  * The first linestring is the outer ring
  * The subsequent ones are holes
  * All linestrings should be linearrings
  *
  * @param array $linestrings The LineString array
  */
 public function __construct(array $linestrings)
 {
     // the GeoJSON spec (http://geojson.org/geojson-spec.html) says nothing about linestring count.
     // What should we do ?
     if (count($linestrings) > 0) {
         parent::__construct($linestrings);
     } else {
         throw new Exception("Polygon without an exterior ring");
     }
 }
Example #14
0
 function __construct($name, $config)
 {
     parent::__construct($config);
     $this->statut_id = substr($this->get_code_from_name($name), 1);
     $query = "select gestion_libelle from notice_statut where id_notice_statut = " . $this->statut_id;
     $result = mysql_query($query);
     if (mysql_num_rows($result)) {
         $this->statut_libelle = mysql_result($result, 0, 0);
     }
     $this->type = "statut";
 }
Example #15
0
 public function __construct($cSaveMode, array $aItems = array())
 {
     if ($aItems) {
         if (!self::isAModelArray($aItems)) {
             throw new \Exception(__METHOD__ . "() : L'argument #2 doit être un tableau d'instance(s) de Model.");
         }
         $this->_sModelName = self::getModelNameFromInstance($aItems[array_rand($aItems)]);
     }
     $this->setDefaultSaveMode($cSaveMode);
     parent::__construct($aItems);
 }
Example #16
0
 /**
  * @param bool $refresh
  * @param null $callback
  */
 public function __construct($refresh = false, $callback = null)
 {
     parent::__construct($this->repository);
     $this->fetch($refresh, $callback);
     $this->data = json_decode($this->raw);
     $this->version = @$this->data->version ?: '-';
     $this->date = @$this->data->date ?: '-';
     foreach ($this->data->assets as $slug => $data) {
         $this->items[$slug] = new Package($data);
     }
 }
Example #17
0
 public function __construct($url, $title, $items = null, $id = null)
 {
     $this->url = $url;
     $this->title = $title;
     if ($items !== null) {
         $this->items = $items;
     }
     if ($id !== null) {
         parent::__construct($id);
     }
 }
Example #18
0
 function __construct($attributes = array(), $entities = array())
 {
     $defaults = array();
     $defaults['name'] = 'block';
     $defaults['flag'] = 0;
     $defaults['layer'] = 0;
     $defaults['base'] = array(0, 0, 0);
     $defaults['obliqueAngle'] = 50;
     $defaults['mirror'] = 0;
     $defaults['lastHeight'] = 1;
     $defaults['font'] = 'arial.ttf';
     $defaults['bigFont'] = '';
     parent::__construct(array_merge($defaults, $attributes), $entities);
 }
Example #19
0
 public function __construct($name, $id = null, Collection $parent = null)
 {
     $this->name = $name;
     if ($id !== null) {
         parent::__construct($id);
     }
     $this->children = array();
     if ($parent !== null) {
         $this->parent = $parent;
     }
     if ($this->opened === null) {
         $this->opened = true;
     }
 }
 /**
  * Constructor for all connections
  *
  * @param \Facebook\Core\BaseEntity 	$owner		The Facebook entity id
  * @param string 					$connection	The connection name
  * @param array						$settings	Settings for the connection
  * @return void
  */
 public function __construct(\Facebook\Core\BaseEntity $owner, $connection, $settings = array())
 {
     if (isset($settings['collection'])) {
         $collection = $settings['collection'];
         unset($settings['collection']);
     } else {
         $collection = new Collection(array());
     }
     $this->_collection = $collection;
     parent::__construct($collection);
     $this->_owner = $owner;
     $this->_connection = $connection;
     $this->_settings = $settings;
 }
Example #21
0
 /**
  * @param string $type
  * @param mixed  $parent
  * @param mixed  $value
  * @param mixed  $by
  */
 public function __construct($type, $parent, $value = null, $by = null)
 {
     $this->type = $type;
     $class = __NAMESPACE__ . '\\' . $this->type . 'Model';
     if ($parent instanceof $class) {
         $this->parent = $parent;
         $this->parentId = $parent->id;
     } else {
         if (is_scalar($parent)) {
             $this->parentId = $parent;
         }
     }
     parent::__construct($value, $by);
 }
Example #22
0
 function __construct($name, $config)
 {
     parent::__construct($config);
     global $tdoc;
     if (!sizeof($tdoc)) {
         $tdoc = new \marc_list('doctype');
     }
     $name = str_replace(" (T)", "", $name);
     foreach ($tdoc->table as $key => $label) {
         if ($name == $label) {
             $this->typdoc = $key;
             break;
         }
     }
     $this->type = "typdoc";
 }
Example #23
0
 /**
  * @param array $values The list of server values to create the headers from
  */
 public function __construct(array $values = [])
 {
     // Only add "HTTP_" server values or special case values
     foreach ($values as $name => $value) {
         $name = strtoupper($name);
         if (isset(self::$specialCaseHeaders[$name]) || strpos($name, "HTTP_") === 0) {
             $this->set($name, $value);
         }
     }
     /**
      * Headers allow multiple values
      * The parent class does not have this feature, which is why we took care of it in this constructor
      * To satisfy the parent constructor, we'll simply send it an empty array
      */
     parent::__construct([]);
 }
Example #24
0
 function __construct($attributes = array())
 {
     $defaults = array();
     $defaults['insbase'] = array(0.0, 0.0, 0.0);
     $defaults['extmin'] = array(0.0, 0.0);
     $defaults['extmax'] = array(0.0, 0.0);
     $defaults['fileName'] = 'test.dxf';
     //$defaults['tdcreate'] = time();
     parent::__construct(array_merge($defaults, $attributes));
     $this->attributes['acadver'] = "9\n\$ACADVER\n1\nAC1009\n";
     //version R14
     $this->blocks = array();
     $this->header = array($this->attributes['acadver']);
     $this->layers = array(new Layer());
     $this->lineTypes = array(new LineType());
     $this->styles = array(new Style());
     $this->views = array();
     //echo print_r($this->attributes);
 }
Example #25
0
 /**
  * The constructor here doesn't really need to do much other than call the parent constructor
  * @param String $collection
  */
 public function __construct($collection)
 {
     parent::__construct($collection);
 }
Example #26
0
 /**
  * Set the value of an array native type
  *
  * @param array $value
  */
 public function __construct($value)
 {
     $this->_type = self::XMLRPC_TYPE_ARRAY;
     parent::__construct($value);
 }
Example #27
0
 /**
  * 建構子
  * @param integer|Generic_object $id
  * @return Generic_collection
  */
 function __construct($id = NULL)
 {
     parent::__construct();
     if (is_int($id) or is_string($id)) {
         $this->set_id($id);
     } else {
         if (is_object($id)) {
             $this->set_index_object($id);
         }
     }
     if (isset($this->id) && isset($this->index_field)) {
         $key = $this->index_field;
         $value = $this->id;
         $coll = get_cache($this, $key, $value);
         if (isset($coll)) {
             $this->_import($coll);
             return $this;
         } else {
             set_cache($this, $key, $value);
         }
     }
     $this->_post_construct();
     return $this;
 }
 public function __construct($where = false, $order_by = false)
 {
     parent::__construct($this->table, $where, $order_by);
 }
Example #29
0
 /**
  * @Override
  */
 function __construct($data)
 {
     parent::__construct($data);
     $this->setType(Post::PHOTOREP);
 }
Example #30
0
 public function __construct($data = array())
 {
     parent::__construct($data);
     $this->_basePath = APP_PATH . '/config/';
 }