AirLay backend

DepartmentEntity extends DatabaseEntity
in package

Table of Contents

ALLOWED_CONTACTS_TYPE  = ['email', 'telegram']
TYPES  = ['root', 'node']
$_id  : ObjectId
$children  : array<string|int, mixed>
$code  : string
$contacts  : array<string|int, mixed>
$coordinates  : array<string|int, mixed>
$dataSets  : array<string|int, mixed>
$name  : string
$organizationId  : ObjectId
$properties  : array<string|int, mixed>
$type  : string
$users  : array<string|int, mixed>
__construct()  : mixed
__toString()  : string
addChild()  : self
addDataset()  : self
addUser()  : self
bsonSerialize()  : array<string|int, mixed>
bsonUnserialize()  : void
deleteAllChildren()  : self
deleteAllDatasets()  : self
deleteAllUsers()  : self
deleteChild()  : self
deleteDataset()  : self
deleteUser()  : self
fromArray()  : DepartmentEntity
getChildren()  : array<string|int, mixed>
getCode()  : string
getContacts()  : array<string|int, array<string|int, mixed>>
getCoordinates()  : array<string|int, mixed>
getDataSets()  : array<string|int, array<string|int, mixed>>
getId()  : ObjectId
getName()  : string
getOrganizationId()  : ObjectId
getProperties()  : array<string|int, mixed>
getProperty()  : mixed
getType()  : string
getUsers()  : array<string|int, mixed>
jsonSerialize()  : array<string|int, mixed>
parseObjectId()  : ObjectId|null
setChildren()  : self
setCode()  : self
setContacts()  : $this
setCoordinates()  : self
setDataSets()  : self
setId()  : self
setName()  : self
setOrganizationId()  : self
setProperties()  : self
setUsers()  : self
toArray()  : array<string|int, mixed>
validateContact()  : void

Constants

ALLOWED_CONTACTS_TYPE

public mixed ALLOWED_CONTACTS_TYPE = ['email', 'telegram']

Properties

Methods

__construct()

public __construct(ObjectId $organizationId, string $type[, ObjectId|null $id = null ]) : mixed
Parameters
$organizationId : ObjectId
$type : string
$id : ObjectId|null = null
Return values
mixed

__toString()

public __toString() : string
Return values
string

addChild()

public addChild(ObjectId $departmentId) : self
Parameters
$departmentId : ObjectId
Return values
self

addDataset()

public addDataset(ObjectId $datasetId, string $filter, bool $applyToRead) : self
Parameters
$datasetId : ObjectId
$filter : string
$applyToRead : bool
Return values
self

addUser()

public addUser(ObjectId $userId) : self
Parameters
$userId : ObjectId
Return values
self

bsonSerialize()

public bsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

bsonUnserialize()

public bsonUnserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>
Return values
void

deleteAllChildren()

public deleteAllChildren() : self
Return values
self

deleteAllDatasets()

public deleteAllDatasets() : self
Return values
self

deleteChild()

public deleteChild(ObjectId $departmentId) : self
Parameters
$departmentId : ObjectId
Return values
self

deleteDataset()

public deleteDataset(ObjectId $datasetId) : self
Parameters
$datasetId : ObjectId
Return values
self

deleteUser()

public deleteUser(ObjectId $userId) : self
Parameters
$userId : ObjectId
Return values
self

getChildren()

public getChildren() : array<string|int, mixed>
Return values
array<string|int, mixed>

getContacts()

public getContacts() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>

getCoordinates()

public getCoordinates() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDataSets()

public getDataSets() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>

getOrganizationId()

public getOrganizationId() : ObjectId
Return values
ObjectId

getProperties()

public getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProperty()

public getProperty(string $key) : mixed
Parameters
$key : string
Return values
mixed

getUsers()

public getUsers() : array<string|int, mixed>
Return values
array<string|int, mixed>

jsonSerialize()

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

parseObjectId()

public static parseObjectId(mixed $objectId) : ObjectId|null
Parameters
$objectId : mixed
Return values
ObjectId|null

setChildren()

public setChildren(array<string|int, mixed> $children) : self
Parameters
$children : array<string|int, mixed>
Return values
self

setCode()

public setCode(string $code) : self
Parameters
$code : string
Return values
self

setContacts()

public setContacts(array<string|int, array<string|int, mixed>> $contacts) : $this
Parameters
$contacts : array<string|int, array<string|int, mixed>>
Tags
example

$this->setContacts([['type' => 'email', 'value' => 'example@mail.ru'], ['type' => 'telegram', 'value' => '195570004']])

Return values
$this

setCoordinates()

public setCoordinates(array<string|int, mixed> $coordinates) : self
Parameters
$coordinates : array<string|int, mixed>
Return values
self

setDataSets()

public setDataSets(array<string|int, mixed> $dataSets) : self
Parameters
$dataSets : array<string|int, mixed>
Return values
self

setId()

public setId(ObjectId $id) : self
Parameters
$id : ObjectId
Return values
self

setName()

public setName(string $name) : self
Parameters
$name : string
Return values
self

setOrganizationId()

public setOrganizationId(ObjectId $organizationId) : self
Parameters
$organizationId : ObjectId
Return values
self

setProperties()

public setProperties(array<string|int, mixed> $properties) : self
Parameters
$properties : array<string|int, mixed>
Return values
self

setUsers()

public setUsers(array<string|int, mixed> $users) : self
Parameters
$users : array<string|int, mixed>
Return values
self

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

validateContact()

private validateContact(array<string|int, mixed> $contact) : void
Parameters
$contact : array<string|int, mixed>
Return values
void

Search results