Elgg\Database\UsersTable::getByEmail PHP Method

getByEmail() public method

Get an array of users from an email address
public getByEmail ( string $email ) : array
$email string Email address
return array
    public function getByEmail($email)
    {
        if (!$email) {
            return [];
        }
        $users = $this->entities->getEntitiesFromAttributes(['types' => 'user', 'attribute_name_value_pairs' => ['name' => 'email', 'value' => $email], 'limit' => 1]);
        return $users ?: [];
    }