Create a new visitor if is unknown.

@return bool
5806
private function createVisitorIfIsUnknown()
    {
        $model = $this->getModel();

        /** @var  \Arcanedev\LaravelTracker\Models\Visitor  $visitor */
        if ($this->isVisitorKnown()) {
            $visitor = $model->newQuery()->find($id = $this->getVisitorData($model->getKeyName()));
            $visitor->updated_at = Carbon::now();
            $visitor->save();

            $this->setVisitorId($id);

            return true;
        }

        $visitor = $model->newQuery()
            ->firstOrCreate(Arr::only($this->visitorInfo, ['uuid']), $this->visitorInfo);

        $this->setVisitorId($visitor->getKey());
        $this->putSessionData($this->visitorInfo);

        return false;
    }
33574
public function onAfterInit()
    {
        // Suppress errors if dev/build necessary
        if (!Security::database_is_ready()) {
            return false;
        }
        $currentMember = Security::getCurrentUser();
        if (!$currentMember || !$currentMember->exists()) {
            return false;
        }

        $statusCode = $this->owner->getResponse()->getStatusCode();

        if (substr($statusCode, 0, 1) == '4') {
            $this->logPermissionDenied($statusCode, $currentMember);
        }
    }
286654
public function createNewEmbed()
    {
        $embed = $this->store->loadEmbed($this->getMetadata(), []);
        $embed->getState()->setNew();
        return $embed;
    }
556037
public function create() {
		if (!isset($this->wurflManager)) {
			$this->init();
		}
		if ($this->hasToBeReloaded()) {
			$this->reload();
		}
		
		return $this->wurflManager;
	}
1000365
public function create()
    {
        // Validate form
        $form = $this->getForm('Create' . $this->getEntityName());
        if (!$form->isValid()) {
            return false;
        }

        // Insert new entity
        $now    = new \DateTime();
        $entity = $form->getData();
        $entity->setLastModified($now);
        $entity->setCreated($now);

        // Trigger oncreate
        $this->onCreate($entity);

        // Save
        $this->getEntityManager()->persist($entity);
        return $this->save($this->getEntityName() . ' created.', 'Unable to create ' . strtolower($this->getEntityName()) . '.');
    }
842833
public function visitor($visitorId = null)
  {
    if($visitorId === null)
    {
      $visitorId = $this->getVisitorIdCookie();
    }
    return Visitor::newInstance($this)
      ->setVisitorId($visitorId);
  }
773757
public function newEWS()
    {
        // Discovery not yet attempted.
        if ($this->discovered === null) {
            $this->discover();
        }

        // Discovery not successful.
        if ($this->discovered === false) {
            return false;
        }

        $server = false;
        $version = null;

        // Pick out the host from the EXPR (Exchange RPC over HTTP).
        foreach ($this->discovered['Account']['Protocol'] as $protocol) {
            if (($protocol['Type'] == 'EXCH' || $protocol['Type'] == 'EXPR')
                && isset($protocol['ServerVersion'])) {
                if ($version === null) {
                    $sv = $this->parseServerVersion($protocol['ServerVersion']);
                    if ($sv !== false) {
                        $version = $sv;
                    }
                }
            }

            if ($protocol['Type'] == 'EXPR' && isset($protocol['Server'])) {
                $server = $protocol['Server'];
            }
        }

        if ($server) {
            if ($version === null) {
                // EWS class default.
                $version = Client::VERSION_2007;
            }
            return new Client(
                $server,
                (!empty($this->username) ? $this->username : $this->email),
                $this->password,
                $version
            );
        }

        return false;
    }
1283368
public static function make()
    {
        $visit = null;

        /**
         * Triggered before a new **visit tracking object** is created. Subscribers to this
         * event can force the use of a custom visit tracking object that extends from
         * {@link Piwik\Tracker\VisitInterface}.
         *
         * @param \Piwik\Tracker\VisitInterface &$visit Initialized to null, but can be set to
         *                                              a new visit object. If it isn't modified
         *                                              Piwik uses the default class.
         */
        Piwik::postEvent('Tracker.makeNewVisitObject', array(&$visit));

        if (!isset($visit)) {
            $visit = new Visit();
        } elseif (!($visit instanceof VisitInterface)) {
            throw new Exception("The Visit object set in the plugin must implement VisitInterface");
        }

        return $visit;
    }
844991
public function create()
    {
        $instance = self::createBraintreeGateway($this);
        $this->setId($instance->getId());
        return $instance;
    }
582296
private function ensureVisitorDataIsComplete()
    {
        $visitorData = $this->getVisitorData();
        $completed   = true;

        foreach ($this->visitorInfo as $key => $value) {
            if ($visitorData[$key] !== $value) {
                /** @var  \Arcanedev\LaravelTracker\Models\Visitor  $model */
                if ( ! isset($model))
                    $model = $this->getModel()->find($this->getVisitorId());

                $model->setAttribute($key, $value);
                $model->save();

                $completed = false;
            }
        }

        if ( ! $completed)
            $this->putSessionData($this->visitorInfo);
    }
440630
public function newInstance(
        string $createdByUserId,
        string $createdReason = Tracking::UNKNOWN_REASON
    ) {
        /** @var static $new */
        $new = parent::newInstance(
            $createdByUserId,
            $createdReason
        );

        // if no id, then it has not been save and can be returned
        if (empty($new->pluginInstanceId)) {
            return $new;
        }

        $new->pluginInstanceId = null;
        $new->previousEntity = null;

        return $new;
    }
269610
public function createSentinel()
    {
        $persistence = $this->createPersistence();
        $users       = $this->createUsers();
        $roles       = $this->createRoles();
        $activations = $this->createActivations();
        $dispatcher  = $this->getEventDispatcher();

        $sentinel = new Sentinel(
            $persistence,
            $users,
            $roles,
            $activations,
            $dispatcher
        );

        $throttle = $this->createThrottling();

        $ipAddress = $this->getIpAddress();

        $checkpoints = $this->createCheckpoints($activations, $throttle, $ipAddress);

        foreach ($checkpoints as $key => $checkpoint) {
            $sentinel->addCheckpoint($key, $checkpoint);
        }

        $reminders = $this->createReminders($users);

        $sentinel->setActivationRepository($activations);

        $sentinel->setReminderRepository($reminders);

        $sentinel->setThrottleRepository($throttle);

        return $sentinel;
    }
783874
public function create()
    {
        if (!$this->name) {
            throw new UnexpectedValueException(
                'Cannot create a user with no name'
            );
        }

        $parts = array('CREATE USER :user');
        $params = array(':user' => $this->name);

        if ($this->host) {
            $parts[] = '@:host';
            $params[':host'] = strtolower($this->host) == 'any' ? '%' : $this->host;
        }
        if ($this->password) {
            $parts[] = 'IDENTIFIED BY :password';
            $params[':password'] = $this->password;
        }

        // Wrap in 'FLUSH PRIVILEGES' commands to update in-memory state
        $this->client->execute('FLUSH PRIVILEGES');
        $this->client->execute(implode(' ', $parts), $params);
        $this->client->execute('FLUSH PRIVILEGES');
    }
878433
public function create()
    {
        try {
            $this->dispatch(new AttemptRememberingUser());
            return redirect()->intended($this->config->get('authentication.login.redirectUri'));
        } catch (RememberingUserFailed $e) {
            return view('authentication::session.create');
        }
    }
497604
protected function createEntry()
    {
        $entry = new Entry();
        $entry->setVisible(false)
              ->setName($this->name);
        $this->setEntry($entry);
        return $entry;
    }
978269
public static function create()
	{
		if ( file_exists( self::$authFile ) ) return false;
		if ( @touch( self::$authFile ) === false ) return false;

		self::$auth = array(
			'generated' => date('U'),
			'security'  => self::generateSecurityToken(),
			'anonymous' => array(),
			'users'     => array(),
		);

		self::save();

		return true;
	}
632188
public function create()
    {
        $roles = $this->roleRepositoryInterface->getAll()
                                               ->lists('name', 'slug');

        return $this->view('users.create')
                    ->with('roles', $roles);
    }