$objType
$objType : string|null
Action: Create an object and insert into storage.
obj_type
(string) — The object type, as an identifier for a \Charcoal\Model\ModelInterface.success
(boolean) — TRUE if the object was properly saved, FALSE in case of any error.obj_id
(mixed) — The created object ID, if any.obj
(array) — The created object data.200
— Successful; Object has been created400
— Client error; Invalid request data500
— Server error; Object could not be created$adminConfig : \Charcoal\Admin\Config
Store a reference to the admin configuration.
setObj(\Charcoal\Model\ModelInterface|null $obj) : \Charcoal\Admin\Action\Object\SaveAction
\Charcoal\Model\ModelInterface|null | $obj | The object. |
Chainable
addFeedbackFromValidation(\Charcoal\Model\ModelInterface $obj, array<mixed,string>|string|null $filters = null) : \Charcoal\Admin\Action\Object\SaveAction
Merge the given object's validation results the response feedback.
\Charcoal\Model\ModelInterface | $obj | The validated object. |
array<mixed,string>|string|null | $filters | Filter the levels to merge. |
If the filters are invalid.
Chainable
setObjType(string $objType) : \Charcoal\Admin\Ui\ObjectContainerInterface
Set the object type.
string | $objType | The object type. |
If provided argument is not of type 'string'.
Chainable
setObjId(string|\Charcoal\Admin\Ui\numeric $objId) : \Charcoal\Admin\Ui\ObjectContainerInterface
Set the object ID.
string|\Charcoal\Admin\Ui\numeric | $objId | The object ID to load. |
If provided argument is not of type 'scalar'.
Chainable
setObjBaseClass(string $objBaseClass) : \Charcoal\Admin\Ui\ObjectContainerInterface
string | $objBaseClass | The base class. |
If provided argument is not of type 'string'.
Chainable
init(\Psr\Http\Message\RequestInterface $request) : boolean
Template's init method is called automatically from `charcoal-app`'s Template Route.
For admin templates, initializations is:
$_GET
\Psr\Http\Message\RequestInterface | $request | The request to initialize. |
addFeedback(string $level, mixed $message) : \Charcoal\Admin\Ui\FeedbackContainerTrait
Add feedback.
string | $level | The feedback level. |
mixed | $message | The feedback message. |
Chainable
clearFeedback() : \Charcoal\Admin\Ui\FeedbackContainerTrait
Remove all feedback from collection.
Chainable
setData(array $data) : \Charcoal\Admin\Action\Object\SaveAction
Set the action's dataset.
Extract relevant model data from $data, excluding object type. This \self::$saveData is merged onto the target model.
array | $data | The update action data. |
Chainable
setSaveData(array $saveData) : \Charcoal\Admin\Action\Object\SaveAction
Set the dataset used to create the target model.
array | $saveData | The save data. |
Chainable
run(\Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response) : \Psr\Http\Message\ResponseInterface
\Psr\Http\Message\RequestInterface | $request | A PSR-7 compatible Request instance. |
\Psr\Http\Message\ResponseInterface | $response | A PSR-7 compatible Response instance. |
setModelFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Admin\AdminScript
\Charcoal\Factory\FactoryInterface | $factory | The factory used to create models. |
Chainable
setSiteName(string $name) : \Charcoal\Admin\AdminAction
Set the name of the project.
string | $name | Name of the project. |
Chainable