Get an array of most recent tracks.

@param string $username

@return Lastfm
775641
public function userRecentTracks(string $username): Lastfm
    {
        $this->query = array_merge($this->query, [
            'method' => 'user.getRecentTracks',
            'user' => $username,
        ]);

        $this->pluck = 'recenttracks.track';

        return $this;
    }
275230
public function listUserReceiveEvents(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username/received_events', $username));
    }
367033
public function last()
    {
        $last = null;
        foreach ($this->each() as $v) {
            $last = $v;
        }
        return $last;
    }
498205
public function getAttemptsLeftWithSameUser(string $userName): int
    {
        $attemptsLeft = ((int) $this->maxAttemptsForUserName) - $this->enhancedAuthenticationMapper->fetchAttemptsWithSameUser($userName, $this->banTimeInSeconds);

        return \max(0, $attemptsLeft);
    }
1012531
public function getByUsername($username)
    {
        $filter = new IteratorFilter();
        $filter->addRelation($this->getUserDefinition()->getUsername(), Relation::EQUAL, $username);
        return $this->getUser($filter);
    }
1055846
public function username($username = null)
    {
        if (func_num_args() === 0) {
            return $this->_username;
        }
        $this->_username = $username ?: null;
        return $this;
    }
633053
public function getByUsername($username)
    {
        if (!is_string($username)) {
            return false;
        }

        $data = [
            'where' => [
                [
                    'column' => $this->tableAlias . '.username',
                    'value'  => $username,
                ],
            ],
        ];

        $user = $this->getAll(null, null, $data);

        return empty($user) ? false : $user[0];
    }
407540
public function getUserMedia($id = 'self', $limit = 0)
    {
        $params = array();

        if ($limit > 0) {
            $params['count'] = $limit;
        }

        return $this->_makeCall('users/' . $id . '/media/recent', strlen($this->getAccessToken()), $params);
    }
1193391
public function loadUserByUsername($username)
    {
        /** @var EntityManager $doctrine */
        $doctrine = $this->doctrine->getManager();

        return $doctrine->getRepository($this->userClass)->findOneBy(['username' => $username]);
    }
516329
public function get_recently_active_sessions($seconds=600) {
		if(is_null($seconds) || !is_numeric($seconds)) {
			$seconds = 10;
		}
		$sql = "SELECT session_id, uid, date_created, last_updated, num_checkins
			FROM cswal_session_table WHERE last_updated > NOW() - interval '". $seconds
				." seconds'";
		try {
			$retval = $this->db->run_query($sql);
		}
		catch(Exception $ex) {
			throw new Exception($ex);
		}
		
		return($retval);
	}
725241
public function getLastLogon($username)
    {
        $this->adldap->utilities()->validateNotNull('Username', $username);

        $userInfo = $this->info($username, ['lastlogontimestamp']);

        if (is_array($userInfo) && array_key_exists('lastlogontimestamp', $userInfo)) {
            return AdldapUtils::convertWindowsTimeToUnixTime($userInfo['lastlogontimestamp']);
        }

        return false;
    }
14901
function lastVisit()
    {
        $db = eZDB::instance();

        $userVisitArray = $db->arrayQuery( "SELECT last_visit_timestamp FROM ezuservisit WHERE user_id=$this->ContentObjectID" );
        if ( isset( $userVisitArray[0] ) )
        {
            return $userVisitArray[0]['last_visit_timestamp'];
        }
        else
        {
            return time();
        }
    }
812923
public function getByUsername ($username)
    {
        $entity = $this->er->findOneBy(array('username' => $username));

        if (NULL == $entity) {
            throw new Exception("User not found: username=$username");
        }

        return $this->getModel($entity);
    }
778066
public static function findByUsername($username, $checkStatus = true)
    {
        return static::findOne(
            $checkStatus ?
                ['username' => $username, 'status' => self::STATUS_ACTIVE] :
                ['username' => $username]
        );
    }
1360994
public function lastByName($name) {
        for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
            if ($this->tokens[$i]->getName() === $name) {
                return $this->tokens[$i];
            }
        }

        return null;
    }
952625
protected function _query($username) {
		$table = TableRegistry::get($this->_config['userModel']);

		$columns = [];
		foreach ($this->_config['columns'] as $column) {
			$columns[] = [$table->aliasField($column) => $username];
		}
		$conditions = ['OR' => $columns];

		$options = [
			'conditions' => $conditions,
		];

		if (!empty($this->_config['scope'])) {
			$options['conditions'] = array_merge($options['conditions'], $this->_config['scope']);
		}
		if (!empty($this->_config['contain'])) {
			$options['contain'] = $this->_config['contain'];
		}

		$finder = $this->_config['finder'];
		if (is_array($finder)) {
			$options += current($finder);
			$finder = key($finder);
		}

		if (!isset($options['username'])) {
			$options['username'] = $username;
		}

		$query = $table->find($finder, $options);

		return $query;
	}
1338928
public function getUserByName($username)
    {
        return $this->getUsers()->then(function (array $users) use ($username) {
            foreach ($users as $user) {
                if ($user->getUsername() === $username) {
                    return $user;
                }
            }

            throw new UserNotFoundException("The user \"$username\" does not exist.");
        });
    }