Store a user object in the provider

@param string $identifier A unique user identifier, (i.e a username or email address)
@param array $data An associative array of user data
@return KUserInterface     Returns a UserInterface object
437165
public function store($identifier, $data)
    {
        if(!$data instanceof KUserInterface) {
            $data = $this->create($data);
        }

        $this->_users[$identifier] = $data;

        return $data;
    }
864730
public static function set($identifier, $value)
    {
        list($hash, $keys) = self::_parseIdentifier($identifier);

        // Add to _REQUEST hash if original hash is get, post, or cookies
        if (in_array($hash, array('GET', 'POST', 'COOKIE'))) {
            self::set('request.'.implode('.', $keys), $value);
        }

        // Store cookies persistently
        if ($hash == 'COOKIE' && strpos(AnRequest::scheme(), 'http') !== false) {
            // rewrite the $keys as foo[bar][bar]
            $ckeys = $keys; // get a copy
            $name = array_shift($ckeys);
            foreach ($ckeys as $ckey) {
                $name .= '['.$ckey.']';
            }

            if (! setcookie($name, $value)) {
                throw new AnRequestException("Couldn't set cookie, headers already sent.");
            }
        }

        // Store in $GLOBALS
        foreach (array_reverse($keys, true) as $key) {
            $value = array($key => $value);
        }

        // Add the global if it's doesn't exist
        if (! isset($GLOBALS['_'.$hash])) {
            $GLOBALS['_'.$hash] = array();
        }

        $GLOBALS['_'.$hash] = AnHelperArray::merge($GLOBALS['_'.$hash], $value);
    }
1144993
public function tryGetByIdentifier(Identifier $identifier)
    {
        $mapId     = $identifier->getSerialized();
        $className = $identifier->class->getName();

        if (!isset($this->identityMap[$className][$mapId])) {
            return false;
        }

        return $this->identityMap[$className][$mapId];
    }
857348
public function retrieveByID($identifier)
    {
        $user = $this->conn->{$this->table}->findOne(array('_id' => new \MongoId($identifier)));

        if ( ! is_null($user))
        {
            return new MongolUser((array) $user);
        }
    }
592411
public static function getComponentWithIdentifier(string $identifier)
    {
        $components = self::getComponents();
        foreach ($components as $component) {
            if (empty($component->getIdentifier())) {
                continue;
            }
            
            if ($component->getIdentifier() == $identifier) {
                return $component;
            }
        }
        
        return null;
    }
355366
protected function _configure(KObjectIdentifier $identifier, array $data = array())
    {
        //Prevent config settings from being stored in the identifier
        $config = clone $identifier->getConfig();

        //Append the config data from the singleton
        if($identifier->getType() != 'lib' && $this->isSingleton($identifier))
        {
            $parts = $identifier->toArray();

            unset($parts['type']);
            unset($parts['domain']);
            unset($parts['package']);

            //Append the config from the singleton
            $config->append($this->getIdentifier($parts)->getConfig());
        }

        //Append the config data for the object
        $config->append($data);

        //Set the service container and identifier
        $config->object_manager    = $this;
        $config->object_identifier = $identifier;

        return $config;
    }
394872
public function setIdentifier(Identifier $identifier)
    {
        if ($this->identifier !== null) {
            //TODO: throw exception
        }

        $this->identifier = $identifier;

        return $this;
    }
127830
public function retrieveById($identifier)
    {
        $user = $this->conn->table($this->table)->find($identifier);

        if (! is_null($user)) {
            return new GenericUser((array) $user);
        }
    }
258578
public function registerSubscriber($identifier, array $config = array())
    {
        $result = false;

        //Create the complete identifier if a partial identifier was passed
        if (is_string($identifier) && strpos($identifier, '.') === false)
        {
            $identifier = $this->getIdentifier()->toArray();
            $identifier['path'] = array('event', 'subscriber');
            $identifier['name'] = $identifier;
        }

        $identifier = $this->getIdentifier($identifier);
        $class      = $this->getObject('manager')->getClass($identifier);

        if(!$class || !array_key_exists('Kodekit\Library\EventSubscriberInterface', class_implements($class)))
        {
            throw new \UnexpectedValueException(
                'Event Subscriber: '.$identifier.' does not implement Kodekit\Library\EventSubscriberInterface'
            );
        }

        if (!isset($this->__subscribers[(string)$identifier]))
        {
            $listeners = call_user_func(array($class, 'getEventListeners'));/*$class::getEventListeners();*/

            if (!empty($listeners))
            {
                $identifier->getConfig()->merge($config);

                foreach($listeners as $listener) {
                    $this->__listeners[$listener][] = $identifier;
                }
            }

            $this->__subscribers[(string)$identifier] = true;
        }

        return $result;
    }
1170521
public function retrieveByToken($identifier, $token)
	{
		$user = $this->conn->table($this->table)
			->where('id', $identifier)
			->where('remember_token', $token)
			->first();

		return $this->getGenericUser($user);
	}
660697
public function set_method($identifier, $data, $ttl=0)
    {
    	$key = $this->_key($identifier);
    	$this->set($key, $data, $ttl);
    	return $data;
    }
1162114
public function retrieveByToken($identifier, $token)
    {
        $user = $this->getGenericUser(
            $this->conn->table($this->table)->find($identifier)
        );

        return $user && $user->getRememberToken() && hash_equals($user->getRememberToken(), $token)
                    ? $user : null;
    }
1031233
protected function notifyClients(array $identifiers, array $data)
    {
        foreach ($identifiers as $identifier) {
            $client_name = strpos($identifier, ':') !== false
                ? substr($identifier, 0, strpos($identifier, ':'))
                : $identifier
                ;

            $client = $this
                ->getSession()
                ->getClient($this->getPoolerType(), $client_name)
                ;

            if ($client !== null) {
                $client->notify($identifier, $data);
            }
        }

        return $this;
    }
1354056
public function retrieveByToken($identifier, $token)
    {
        $userModel = $this->createUserModel();

        return $userModel->newQuery()
            ->where($userModel->getKeyName(), $identifier)
            ->where($userModel->getRememberTokenName(), $token)
            ->first();
    }
1033511
public function retrieve($identifier)
    {
        $profileData = $this->collection->findOne([
            'identifier' => $identifier,
        ]);

        if($profileData !== null) {
            return $this->createProfileFromProfileData($profileData['profile']);
        }

        return null;
    }
563435
public function updateFromEmbeddedApiResponse(array $data): CustomerInterface
    {
        // we cast to int because for some reason Dandomain can (sometimes) have customers where the id is not set
        // and instead of setting the id to 0, Dandomain sets it to ''
        $id = (int) $data['id'];

        $customer = $this->customerRepository->findOneByExternalId($id);
        if (!$customer) {
            $customer = new Customer();
            $customer->setExternalId($id);
        }

        $customer
            ->setAddress($data['address'])
            ->setAddress2($data['address2'])
            ->setAttention($data['attention'])
            ->setCity($data['city'])
            ->setCountry($data['country'])
            ->setCountryId($data['countryId'])
            ->setEan($data['ean'])
            ->setEmail($data['email'])
            ->setFax($data['fax'])
            ->setName($data['name'])
            ->setPhone($data['phone'])
            ->setState($data['state'])
            ->setZipCode($data['zipCode'])
        ;

        return $customer;
    }
329763
protected function createSignup(array $data, $userId)
    {
        return Signup::create([
            'user_id' => $userId,
            'firstname' => $data['firstname'],
            'surname' => $data['surname'],
            'gender' => $data['gender'],
            'email' => $data['email'],
            'mobile_number' => $data['mobile_number'],
        ]);
    }