「addressClass」と「shippingAddressClass」があります。「ShippingAdress」は「Address」を拡張し、私書箱が検出されたときに「shippingAddress」が無効になることを除いて、両方とも同じように検証します。私書箱は完全に有効な請求先住所ですが、UPS はそれらに発送しません。
仮説として、どの検証のための SF2 ベスト プラクティスは何Bird
ですかextends
Animal
?
検証に使用した .yml を複製する必要がありAnimal
ますか? 基本的に、まったく同じセクションが 2 つ表示されます (以下を参照)。この場合、 はtogetters
とは少し異なりますが、かなり同一の検証ルールが必要です。Animal
Bird
properties
Acme\BlogBundle\Entity\Animal:
properties:
name:
- NotBlank: ~
getters:
isAnimal:
- "True"
Acme\BlogBundle\Entity\Bird:
properties:
name:
- NotBlank: ~
getters:
isAnimal:
- "True"
isBird
- "True"