Files
This commit is contained in:
23
src/Common/Region.php
Normal file
23
src/Common/Region.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Incoviba\Common;
|
||||
|
||||
use Incoviba\API\Common\Alias\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $descripcion
|
||||
* @property string $numeral
|
||||
* @property int $numeracion
|
||||
*/
|
||||
class Region extends Model {
|
||||
public static $_table = 'region';
|
||||
protected static $fields = ['descripcion', 'numeral', 'numeracion'];
|
||||
|
||||
protected ?array $provincias;
|
||||
public function provincias(): ?array {
|
||||
if ($this->provincias === null) {
|
||||
$this->provincias = $this->parentOf(Provincia::class, [Model::CHILD_KEY => 'region']);
|
||||
}
|
||||
return $this->provincias;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user