public function validateCode(ErrorElement $errorElement, $object)
    {
        $code = $object->getCode();
        $registry = $this->getConfigurationPool()->getContainer()->get('blast_core.code_generators');
        $codeGenerator = $registry->getCodeGenerator(Plot::class);
        if (!empty($code) && !$codeGenerator->validate($code)) {
            $msg = 'Wrong format for plot code. It shoud be: ' . $codeGenerator::getHelp();
            $errorElement
                ->with('code')
                    ->addViolation($msg)
                ->end()
            ;
        }
    }
public function validateCode(ErrorElement $errorElement, $object)
    {
        $code = $object->getCode();
        $registry = $this->getConfigurationPool()->getContainer()->get('blast_core.code_generators');
        $codeGenerator = $registry->getCodeGenerator(Plot::class);
        if (!empty($code) && !$codeGenerator->validate($code)) {
            $msg = 'Wrong format for plot code. It shoud be: ' . $codeGenerator::getHelp();
            $errorElement
                ->with('code')
                    ->addViolation($msg)
                ->end()
            ;
        }
    }
public function validateCode ( ErrorElement $ errorElement , $ object ) { $ code = $ object -> getCode ( ) ; $ registry = $ this -> getConfigurationPool ( ) -> getContainer ( ) -> get ( 'blast_core.code_generators' ) ; $ codeGenerator = $ registry -> getCodeGenerator ( Plot :: class ) ; if ( ! empty ( $ code ) && ! $ codeGenerator -> validate ( $ code ) ) { $ msg = 'Wrong format for plot code. It shoud be: ' . $ codeGenerator :: getHelp ( ) ; $ errorElement -> with ( 'code' ) -> addViolation ( $ msg ) -> end ( ) ; } }
Plot code validator.

@param ErrorElement $errorElement
@param Plot         $object
Plot code validator .