Ejemplo n.º 1
0
 /**
  * @param $elementHtml
  */
 public function __construct($elementHtml)
 {
     $this->id = Helpers\RegExp::getFirstMatch(Config::get('maltapark.idForListItem'), $elementHtml);
     $this->img_url = Helpers\RegExp::getFirstMatch(Config::get('maltapark.imgForListItem'), $elementHtml);
     $this->title = strip_tags(Helpers\RegExp::getFirstMatch(Config::get('maltapark.titleForListItem'), $elementHtml));
     $this->price = Helpers\RegExp::getFirstMatch(Config::get('maltapark.priceForListItem'), $elementHtml);
     $this->price_val = Helpers\TextFormatter::currencyStringToFloat($this->price);
     $this->date = Helpers\RegExp::getFirstMatch(Config::get('maltapark.dateForListItem'), $elementHtml);
 }
Ejemplo n.º 2
0
 /**
  * @param $elementHtml
  * @param $itemId
  */
 public function __construct($elementHtml, $itemId)
 {
     $this->id = $itemId;
     $this->img_url = Config::get('maltapark.detailImgUrl');
     $this->img_url .= Helpers\RegExp::getFirstMatch(Config::get('maltapark.imgForItemDetail'), $elementHtml);
     $this->title = strip_tags(Helpers\RegExp::getFirstMatch(Config::get('maltapark.titleForItemDetail'), $elementHtml));
     $this->price = Helpers\RegExp::getFirstMatch(Config::get('maltapark.priceForItemDetail'), $elementHtml);
     $this->price_val = Helpers\TextFormatter::currencyStringToFloat($this->price);
     $this->contact = Config::get('maltapark.contactImgUrl');
     $this->contact .= Helpers\RegExp::getFirstMatch(Config::get('maltapark.contactForItemDetail'), $elementHtml);
     $this->description = strip_tags(Helpers\RegExp::getFirstMatch(Config::get('maltapark.descriptionForItemDetail'), $elementHtml));
     foreach ($this->topDetailsLabel as $lblKey => $lblRegex) {
         $this->{$lblKey} = Helpers\RegExp::getFirstMatch($lblRegex . Config::get('maltapark.topDetailForItemDetail'), $elementHtml);
     }
 }