You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VisitorFactory.php 634B

3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
3 yıl önce
12345678910111213141516171819202122232425
  1. <?php
  2. namespace Lc\CaracoleBundle\Factory\User;
  3. use App\Entity\User\Visitor;
  4. use Lc\CaracoleBundle\Container\User\VisitorContainer;
  5. use Lc\CaracoleBundle\Model\User\VisitorInterface;
  6. use Lc\SovBundle\Factory\AbstractFactory;
  7. class VisitorFactory extends AbstractFactory
  8. {
  9. public static function create(string $cookie, string $ip): VisitorInterface
  10. {
  11. $class = VisitorContainer::getEntityFqcn();
  12. $visitor = new $class;
  13. $visitor->setCookie($cookie);
  14. $visitor->setIp($ip);
  15. $visitor->setTotalVisit(1);
  16. $visitor->setLastAccess(new \DateTime());
  17. return $visitor;
  18. }
  19. }