= $this->first && $number <= $this->last); } public function getProperty($name) { if($this->$name == null) { if($name == "files") { $this->files = VoiceblocknumberFileModel::search(["voicenumberblock_id" => $this->id]); return $this->files; } if($name == "numbers") { $this->numbers = VoicenumberModel::search(["voicenumberblock_id" => $this->id]); return $this->numbers; } if($name == "short_prefix") { $this->short_prefix = substr($this->prefix, strlen($this->countrycode.$this->areacode)); return $this->short_prefix; } if($name == "short_first") { $this->short_first = substr($this->first, strlen($this->countrycode.$this->areacode)); return $this->short_first; } if($name == "short_last") { $this->short_last = substr($this->last, strlen($this->countrycode.$this->areacode)); return $this->short_last; } $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; } }