Files
thetool/application/Filestore/Filestore.php

46 lines
1.0 KiB
PHP

<?php
class Filestore extends mfBaseModel
{
private $editor;
private $creator;
private $histories;
private $file;
public function getProperty($name) {
if($this->$name == null) {
if(!$this->id) {
return null;
}
if($name == "creator") {
$this->creator = new User($this->create_by);
return $this->creator;
}
if($name == "editor") {
$this->editor = new User($this->edit_by);
return $this->editor;
}
if($name == "histories") {
$this->histories=FilestoreHistoryModel::search(["filestore_id="=>$this->id]);
return $this->histories;
}
$classname = ucfirst($name);
$idfield = $name."_id";
$this->$name = new $classname($this->$idfield);
if($this->$name->id) {
return $this->$name;
} else {
return null;
}
}
return $this->$name;
}
}