0

作成時に機能するsymfonyバンドルを作成しましたが、別の場所に移動すると、次のエラーが発生しました。

致命的なエラー:クラス'Symfony \ Component \ Validator \ Constraints\type'が/home/nagel/sites/battlemamono/vendor/symfony/symfony/src/Symfony/Component/Validator/Mapping/Loader/AbstractLoader.phpに見つかりません63

これはバリデーターエラーであり、私が持っている唯一のバリデーターはこれです:

Battlemamono\DatabaseBundle\Entity\Mamono:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: 
            fields: name
            message: A mamono with this name already exists.
            groups: [creation]
properties:
    id:
        - type: integer

    name:
        - NotBlank: ~
        - MaxLength: 30
        - type: string

    family1:
        - NotBlank: ~
        - MaxLength: 30
        - type: string
        - Choice : { callback: getFamily }

    family2:
        - MaxLength: 30
        - type: string
        - Choice : { callback: getFamily }

    element1:
        - NotBlank: ~
        - MaxLength: 30
        - type: string
        - Choice : { callback: getElements }

    element2:
        - MaxLength: 30
        - type: string
        - Choice : { callback: getElements }

    disposition:
        - NotBlank: ~
        - MaxLength: 100
        - type: string
    diet:
       - NotBlank: ~
       - MaxLength: 100
       - type: string

    previousForm:
       - MaxLength: 30
       - type: string

    nextForm:
       - MaxLength: 30
       - type: string

    evolution:
       - MaxLength: 30
       - type: string

    evolutionLove:
      - type: bool

    tags:
      - type: string
      - MaxLength: 100

    description:
     - type: string
     - NotBlank: ~

なぜこれを行うのかわかりません。

4

1 に答える 1

0

あなたは間違った形式でそれを持っています、これはドキュメントが言うことです:

Acme\BlogBundle\Entity\Author:
    properties:
        age:
            - Type:
                type: integer
                message: The value {{ value }} is not a valid {{ type }}.

http://symfony.com/doc/current/reference/constraints/Type.htmlから

于 2013-02-02T13:00:05.297 に答える