eZ\Publish\Core\Base\Exceptions\BadStateException::__construct PHP Метод

__construct() публичный Метод

Generates: "Argument '{$argumentName}' has a bad state: {$whatIsWrong}".
public __construct ( string $argumentName, string $whatIsWrong, Exception $previous = null )
$argumentName string
$whatIsWrong string
$previous Exception
    public function __construct($argumentName, $whatIsWrong, Exception $previous = null)
    {
        $this->setMessageTemplate("Argument '%argumentName%' has a bad state: %whatIsWrong%");
        $this->setParameters(['%argumentName%' => $argumentName, '%whatIsWrong%' => $whatIsWrong]);
        parent::__construct($this->getBaseTranslation(), 0, $previous);
    }

Usage Example

 /**
  * Creates a new exception for $typeId in $status;.
  *
  * @param mixed $typeId
  * @param mixed $status
  */
 public function __construct($typeId, $status)
 {
     parent::__construct('$typeId', sprintf('Type with ID "%s" in status "%s" cannot be unlinked from its last group.', $typeId, $status));
 }
All Usage Examples Of eZ\Publish\Core\Base\Exceptions\BadStateException::__construct
BadStateException