Apple iPhone X 64Gb Silver
'; /** * BarcodeTemplate constructor. * * @param $rowObject */ public function __construct($object) { $this->mergeWith($object); } /** * Get preview. */ public function getPreview() { // Static preview for template with id=1 if (1 == $this->id) { return $this->firstTemplate; } $preview = preg_replace($this->patterns, $this->replacements, $this->template); return $preview; } /** * Merge given object/array fields to own fields. * * @param $object */ protected function mergeWith($object) { // If given variable is object or is array if (is_array($object) || is_object($object)) { // Add each object field to own fields. foreach ($object as $key => $value) { $this->$key = $value; } } } }