/** * Populate the object with the values from the node * * @param Crawler $node * @return Object */ public static function populate(Crawler $node) { // @formatter:off $map = array('description' => trim(str_replace('Description', '', self::getValue($node, '.productText', null, self::CAST_TYPE_STRING))), 'size' => SizeMapper::populate($node), 'title' => self::getValue($node, 'h1', null, self::CAST_TYPE_STRING), 'unitPrice' => UnitPriceMapper::populate($node)); // @formatter:on return parent::fill(self::create(), $map); }
/** * Populate the object with the values from the node * * @param Crawler $node * @return object */ public static function populate(Crawler $node) { $map = array('amount' => (double) substr(self::getValue($node, '.pricing > .pricePerUnit'), 2), 'currencySymbol' => substr(self::getValue($node, '.pricing > .pricePerUnit'), 0, 2)); return parent::fill(self::create(), $map); }
/** * Populate the object with the values from the node * * @param Crawler $node * @return object */ public static function populate(Crawler $node) { $map = array('bytes' => mb_strlen($node->html(), '8bit')); return parent::fill(self::create(), $map); }