/** * @inheritdoc */ protected function setTitle() { if ('none' === $this->title) { $this->title = self::$dom->find('h1', 0)->text(); } parent::setTitle(); }
/** * @inheritdoc */ public function __construct($categoryUrl, $url, $title, $categoryId, $type) { self::$faker = Factory::create(); self::$faker->addProvider(new PhoneNumber(self::$faker)); parent::__construct($categoryUrl, $url, $title, $categoryId, $type); $this->isUncensored(); }
/** * Save imported products links. * * @param \app\models\glabs\objects\BaseObject $object Object. * * @return bool * * @throws InvalidParamException */ public static function saveProductsLinks($object) { if (!$object->getUploadedLink()) { return false; } $fp = fopen(Yii::getAlias('@runtime/products_' . (int) self::$startTime . '.csv'), 'a'); fputcsv($fp, [$object->getUrl(), $object->getUploadedLink()]); fclose($fp); return true; }