/** * @param string $model */ private function seedTable($model, array $data) { $metadata = Metadata::get($model); foreach ($data as $row) { $metadata['orm:query']->insert($row); } }
/** * Returns the metadata for this specific model. * * @return Metadata */ public static function metadata() { return Metadata::get(get_called_class()); }
public function setUp() { parent::setUp(); $this->subject = Metadata::get('Mismatch\\Mock\\Orm'); }
/** * Allows calling static methods on the class as if * they were the start of query chains. * * @param string $method * @param array $args * @return Query */ public static function __callStatic($method, array $args) { $query = Metadata::get(get_called_class())['orm:query']; return call_user_func_array([$query, $method], $args); }
/** * @return Metadata */ protected function foreignMeta() { if (!$this->class instanceof Metadata) { $this->class = Metadata::get($this->class); } return $this->class; }