/** * Load any record. * * @return $this */ public function loadAny() { if (!$this->persistence) { throw new Exception(['Model is not associated with any database']); } if ($this->loaded()) { $this->unload(); } $this->data = $this->persistence->loadAny($this); if ($this->data) { $this->id = $this->data[$this->id_field]; $this->hook('afterLoad'); } else { $this->unload(); } return $this; }