Exemple #1
0
 /**
  * Set object's email into CSV file.
  *
  * @param \app\models\glabs\objects\BaseObject $object Object.
  *
  * @return bool
  *
  * @throws InvalidParamException
  */
 public static function saveObjectsEmails($object)
 {
     if (!$object->getEmails()) {
         return false;
     }
     $fp = fopen(Yii::getAlias('@runtime/emails_' . (int) self::$startTime . '.csv'), 'a');
     fputcsv($fp, array_merge([$object->getUrl()], array_unique($object->getEmails())));
     fclose($fp);
     return true;
 }