24 lines
418 B
PHP
24 lines
418 B
PHP
<?php
|
|
|
|
class System extends Model {
|
|
protected $table = "systems";
|
|
|
|
protected $_computed = [
|
|
"documents" => "get_documents",
|
|
];
|
|
|
|
public function get_documents() {
|
|
$docs = SystemDoc::find([["system", "=", $this->id]])->all();
|
|
$dl = new Collection;
|
|
foreach ($docs as $d) {
|
|
$doc = new Document($d->document);
|
|
if ($doc) {
|
|
$dl->add($doc);
|
|
}
|
|
}
|
|
$dl->sort("title");
|
|
return $dl;
|
|
}
|
|
|
|
}
|