AcMailer\Factory\AbstractAcMailerFactory::canCreate PHP Method

canCreate() public method

Can the factory create an instance for the service?
public canCreate ( Interop\Container\ContainerInterface $container, string $requestedName ) : boolean
$container Interop\Container\ContainerInterface
$requestedName string
return boolean
    public function canCreate(ContainerInterface $container, $requestedName)
    {
        $parts = explode('.', $requestedName);
        if (count($parts) !== 3) {
            return false;
        }
        if ($parts[0] !== self::ACMAILER_PART || $parts[1] !== static::SPECIFIC_PART) {
            return false;
        }
        $specificServiceName = $parts[2];
        $config = $this->getConfig($container);
        return array_key_exists($specificServiceName, $config);
    }
AbstractAcMailerFactory