File: D:/HostingSpaces/SBogers10/farmfun.komma.pro/app/Komma/Kms/Core/ModelServiceInterface.php
<?php
declare(strict_types=1);
namespace App\Komma\Kms\Core;
use App\Komma\Kms\Core\Tree\NestedSets\Nodes\TreeModelInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
/**
* Interface ModelService
*
* Does know how to work with eloquent models.
*/
interface ModelServiceInterface extends AbstractModelHandlerInterface
{
/**
* Sets the for forModelInstance variable to the model that is in the route, if it matches the singular form
* of the slug string variable. If it does not match, forModelInstance will remain null. Take this into account
* in other methods.
*
* @return Model
*/
public function getForModelFromRoute($slug): ? Model;
/**
* This method will create a new model instance.
*
* @return Model
*/
public function newModel(): Model;
/**
* Gets the model query
*
* @return \Illuminate\Database\Query\Builder
*/
public function models();
/**
* This method will build an model tree.
* Used by the Controllers get and set-structure method
*
* @return Model|TreeModelInterface
*/
public function getRootModelForTree(): ?Model;
/**
* Uses the siteService and the Tree service to create a root model if the model uses a tree algorithm
*/
public function createRootTreeModelIfNeeded();
public function getOptionsForSelect(bool $allowNullableSelectOption = false);
public function getOptionsForSelectAsTree(): Collection;
/**
* Returns all models for the sidebar menu in the backend
*
* @return array
*/
public function getModelsForSideBar(): array;
/**
* @return string
*/
public function getModelClassName(): string;
/**
* @param string $modelClassName
* @return void
*/
public function setModelClassName(string $modelClassName): void;
}