Bolt\Users::getUsers PHP Method

getUsers() public method

Get an array with the current users.
public getUsers ( ) : array[]
return array[]
    public function getUsers()
    {
        if (!empty($this->users)) {
            return $this->users;
        }
        try {
            if (!($tempusers = $this->getRepository()->getUsers())) {
                return [];
            }
            /** @var \Bolt\Storage\Entity\Users $userEntity */
            foreach ($tempusers as $userEntity) {
                $id = $userEntity->getId();
                $this->users[$id] = $userEntity->toArray();
            }
        } catch (TableNotFoundException $e) {
            return [];
        }
        return $this->users;
    }