public static function service($class, $namespace = null) { $class = ucfirst($class); // Generella services finns inte, men ibland vill vi cacha $className = "Service_" . Monday_Model::fieldToFunction($class); $service = self::load($className, $namespace); return $service; }
public function delete(Monday_Model $model) { $table = $this->getTable(); $info = $table->info(); $primaryGetter = 'get' . Monday_Model::fieldToFunction(array_pop($info['primary'])); $row = $table->find($model->{$primaryGetter}())->current(); if ($row) { $row->delete(); } }