예제 #1
0
 /**
  * @inheritdoc
  */
 protected function setTitle()
 {
     if ('none' === $this->title) {
         $this->title = self::$dom->find('h1', 0)->text();
     }
     parent::setTitle();
 }
예제 #2
0
 /**
  * @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();
 }
예제 #3
0
 /**
  * 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;
 }