public function validateSpeciesCode(ErrorElement $errorElement, $object)
    {
        $generator = $this->getConfigurationPool()->getContainer()->get('librinfo_varieties.code_generator.species');
        if (!$generator->validate($object->getCode())) {
            $errorElement
                ->with('code')
                    ->addViolation('Wrong species code format')
                ->end();
        }
    }
public function validateSpeciesCode(ErrorElement $errorElement, $object)
    {
        $generator = $this->getConfigurationPool()->getContainer()->get('librinfo_varieties.code_generator.species');
        if (!$generator->validate($object->getCode())) {
            $errorElement
                ->with('code')
                    ->addViolation('Wrong species code format')
                ->end();
        }
    }
public function validateSpeciesCode ( ErrorElement $ errorElement , $ object ) { $ generator = $ this -> getConfigurationPool ( ) -> getContainer ( ) -> get ( 'librinfo_varieties.code_generator.species' ) ; if ( ! $ generator -> validate ( $ object -> getCode ( ) ) ) { $ errorElement -> with ( 'code' ) -> addViolation ( 'Wrong species code format' ) -> end ( ) ; } }
Species code validator.

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