eZ\Publish\Core\Base\Exceptions\NotFoundException::__construct PHP Method

__construct() public method

Generates: Could not find '{$what}' with identifier '{$identifier}'.
public __construct ( string $what, mixed $identifier, Exception $previous = null )
$what string
$identifier mixed
$previous Exception
    public function __construct($what, $identifier, Exception $previous = null)
    {
        $identifierStr = is_string($identifier) ? $identifier : var_export($identifier, true);
        $this->setMessageTemplate("Could not find '%what%' with identifier '%identifier%'");
        $this->setParameters(['%what%' => $what, '%identifier%' => $identifierStr]);
        parent::__construct($this->getBaseTranslation(), self::NOT_FOUND, $previous);
    }

Usage Example

 /**
  * Creates a new exception for $typeId in $status;.
  *
  * @param mixed $typeGroupId
  * @param mixed $status
  */
 public function __construct($typeGroupId)
 {
     parent::__construct('eZ\\Publish\\SPI\\Persistence\\Content\\Type\\Group', sprintf('ID: %s', $typeGroupId));
 }
All Usage Examples Of eZ\Publish\Core\Base\Exceptions\NotFoundException::__construct
NotFoundException