for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://github.com/flipboxfactory/craft-ember/blob/master/LICENSE
* @link https://github.com/flipboxfactory/craft-ember/
*/
namespace flipbox\craft\ember\actions\elements;
use craft\base\ElementInterface;
use yii\base\Action;
* @author Flipbox Factory <[email protected]>
* @since 2.0.0
abstract class CreateElement extends Action
{
use SaveElementTrait;
* @inheritdoc
* @return ElementInterface
abstract protected function newElement(array $config = []): ElementInterface;
* @throws \Throwable
* @throws \craft\errors\ElementNotFoundException
* @throws \yii\base\Exception
* @throws \yii\web\HttpException
* @throws \yii\web\UnauthorizedHttpException
public function run()
return $this->runInternal($this->newElement());
}
public function statusCodeSuccess(): int
return $this->statusCodeSuccess ?: 201;