Contao Utils Bundle

MemberUtil
in package
uses PersonTrait

Table of Contents

Constants

TABLE  = 'tl_member'

Properties

$framework  : ContaoFrameworkInterface
$modelUtil  : ModelUtil

Methods

__construct()  : mixed
addHomeDir()  : bool|string
Adds a new home dir to a member. Therefore a folder named with the members's id is created in $varRootFolder.
findActiveByGroups()  : MemberModel|array<string|int, MemberModel>|Collection|null
Find active members by member group.
findOrCreate()  : mixed
getHomeDir()  : bool|string
Returns a member home dir and creates one, if desired.

Constants

Properties

$framework

protected ContaoFrameworkInterface $framework

Methods

__construct()

public __construct(ContaoFrameworkInterface $framework, ModelUtil $modelUtil) : mixed
Parameters
$framework : ContaoFrameworkInterface
$modelUtil : ModelUtil

addHomeDir()

Adds a new home dir to a member. Therefore a folder named with the members's id is created in $varRootFolder.

public static addHomeDir(mixed $member[, mixed $booleanProperty = 'assignDir' ][, mixed $propertyName = 'homeDir' ][, mixed $rootFolder = 'files/members' ][, bool|false $overwrite = false ]) : bool|string
Parameters
$member : mixed

MemberModel|int The member as object or member id

$booleanProperty : mixed = 'assignDir'

string The name of the boolean member property (e.g. "assignDir")

$propertyName : mixed = 'homeDir'

string The name of the member property (e.g. "homeDir")

$rootFolder : mixed = 'files/members'

string|object The base folder as instance of \FilesModel, path string or uuid

$overwrite : bool|false = false

bool Determines if an existing folder can be overridden

Return values
bool|string

returns true, if a directory has already been linked with the member, the folders uuid if successfully added and false if errors occurred

findActiveByGroups()

Find active members by member group.

public findActiveByGroups(array<string|int, mixed> $groups[, array<string|int, mixed> $options = [] ]) : MemberModel|array<string|int, MemberModel>|Collection|null

Options (pass via options array):

  • ignoreLogin: (bool) Ignore login field when check for active state. Default: false
Parameters
$groups : array<string|int, mixed>
$options : array<string|int, mixed> = []
Return values
MemberModel|array<string|int, MemberModel>|Collection|null

findOrCreate()

public findOrCreate(string $email) : mixed
Parameters
$email : string

getHomeDir()

Returns a member home dir and creates one, if desired.

public static getHomeDir(mixed $member[, mixed $booleanProperty = 'assignDir' ][, mixed $propertyName = 'homeDir' ][, mixed $rootFolder = 'files/members' ][, bool|false $overwrite = false ]) : bool|string
Parameters
$member : mixed

MemberModel|int The member as object or member id

$booleanProperty : mixed = 'assignDir'

string The name of the boolean member property (e.g. "assignDir")

$propertyName : mixed = 'homeDir'

string The name of the member property (e.g. "homeDir")

$rootFolder : mixed = 'files/members'

string|FilesModel The base folder as instance of FilesModel, path string or uuid

$overwrite : bool|false = false

bool Determines if an existing folder can be overridden

Return values
bool|string

returns the home dir or false if an error occurred


        
On this page

Search results