Medical Appointments API

MunicipalityEntity extends BaseEntity
in package

This class represents an entity for a municipality, extending the BaseEntity class.

The template parameter specifies the type of the entity's ID, which is an integer in this case.

Tags
extends

BaseEntity

author

Luis Graciano contacto@luisgraciano.dev

Table of Contents

$id  : mixed
$latitude  : float|null
$longitude  : float|null
$name  : string|null
$provinceId  : int|null
bind()  : void
Bind data to the entity properties.
fields()  : array<string|int, mixed>
Get the names of the entity properties as an array.
getId()  : I
Get the ID of the entity.
getLatitude()  : float|null
Get the latitude of the municipality's location.
getLongitude()  : float|null
Get the longitude of the municipality's location.
getName()  : string|null
Get the name of the municipality.
getProvinceId()  : int|null
Get the ID of the province to which the municipality belongs.
setId()  : void
Set the ID of the entity.
setLatitude()  : void
Set the latitude of the municipality's location.
setLongitude()  : void
Set the longitude of the municipality's location.
setName()  : void
Set the name of the municipality.
setProvinceId()  : void
Set the ID of the province to which the municipality belongs.
values()  : array<string|int, mixed>
Get the values of the entity properties as an array.
valuesAsMap()  : array<string|int, mixed>
Get the values of the entity properties as a map.

Properties

$id

private mixed $id

The ID of the entity. The type of the ID is determined by the template parameter.

$latitude

private float|null $latitude = null

The latitude of the municipality's location.

$longitude

private float|null $longitude = null

The longitude of the municipality's location.

$provinceId

private int|null $provinceId = null

The ID of the province to which the municipality belongs.

Methods

bind()

Bind data to the entity properties.

public bind(array<string|int, mixed> $data) : void

This method takes an associative array of data and binds the values to the entity's properties. It matches the keys of the data array with the properties defined in the entity's database model class, and if there is a match, it sets the property value using the corresponding setter method.

Parameters
$data : array<string|int, mixed>

An associative array containing the data to bind to the entity properties.

Return values
void

fields()

Get the names of the entity properties as an array.

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

An array containing the names of the entity properties.

getId()

Get the ID of the entity.

public getId() : I
Return values
I

The ID of the entity.

getLatitude()

Get the latitude of the municipality's location.

public getLatitude() : float|null
Return values
float|null

The latitude of the municipality's location.

getLongitude()

Get the longitude of the municipality's location.

public getLongitude() : float|null
Return values
float|null

The longitude of the municipality's location.

getName()

Get the name of the municipality.

public getName() : string|null
Return values
string|null

The name of the municipality.

getProvinceId()

Get the ID of the province to which the municipality belongs.

public getProvinceId() : int|null
Return values
int|null

The ID of the province to which the municipality belongs.

setId()

Set the ID of the entity.

public setId(I $id) : void
Parameters
$id : I

The ID to set for the entity.

Return values
void

setLatitude()

Set the latitude of the municipality's location.

public setLatitude(float|null $latitude) : void
Parameters
$latitude : float|null

The latitude of the municipality's location to set.

Return values
void

setLongitude()

Set the longitude of the municipality's location.

public setLongitude(float|null $longitude) : void
Parameters
$longitude : float|null

The longitude of the municipality's location to set.

Return values
void

setName()

Set the name of the municipality.

public setName(string|null $name) : void
Parameters
$name : string|null

The name of the municipality to set.

Return values
void

setProvinceId()

Set the ID of the province to which the municipality belongs.

public setProvinceId(int|null $provinceId) : void
Parameters
$provinceId : int|null

The ID of the province to set for the municipality.

Return values
void

values()

Get the values of the entity properties as an array.

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

This method retrieves the values of all properties defined in the entity's database model class and returns them as an array. The array represents the values that can be used in database operations.

Return values
array<string|int, mixed>

An array containing the values of the entity properties.

valuesAsMap()

Get the values of the entity properties as a map.

public valuesAsMap() : array<string|int, mixed>

This method retrieves the values of all properties defined in the entity's database model class and returns them as an associative array, where the keys represent the property names and the values are the corresponding property values.

Return values
array<string|int, mixed>

An associative array containing the values of the entity properties.

Search results