Skip to content

Commit

Permalink
Merge pull request #1 from molchanoviv/fix
Browse files Browse the repository at this point in the history
mapping issues fixes and deprecated functions removing
  • Loading branch information
bakulinav committed Jun 24, 2013
2 parents 28bd3ed + 0e33469 commit 1b0e233
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Expand Up @@ -31,7 +31,7 @@ class OptionValueChoiceType extends AbstractType
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$choiceList = function (Options $options) {
return new ObjectChoiceList($options['option']->getValues(), 'value', array(), null, null, PropertyAccess::getPropertyAccessor());
return new ObjectChoiceList($options['option']->getValues(), 'value', array(), null, null, PropertyAccess::createPropertyAccessor());
};

$resolver
Expand Down
Expand Up @@ -28,7 +28,7 @@
<join-column name="product_id" referenced-column-name="id" nullable="false" unique="false" />
</join-columns>
<inverse-join-columns>
<join-column name="option_id" referenced-column-name="id" nullable="false" nique="false" />
<join-column name="option_id" referenced-column-name="id" nullable="false" unique="false" />
</inverse-join-columns>
</join-table>
</many-to-many>
Expand Down
Expand Up @@ -29,7 +29,6 @@
<gedmo:timestampable on="update"/>
</field>
<field name="deletedAt" column="deleted_at" type="datetime" nullable="true" />
<gedmo:soft-deleteable field-name="deletedAt" />

<many-to-one field="product" target-entity="Sylius\Bundle\ProductBundle\Model\ProductInterface" inversed-by="variants">
<join-column name="product_id" referenced-column-name="id" nullable="false" />
Expand All @@ -46,6 +45,8 @@
</join-table>
</many-to-many>

<gedmo:soft-deleteable field-name="deletedAt" />

</mapped-superclass>

</doctrine-mapping>
Expand Up @@ -52,7 +52,7 @@ public function validate($value, Constraint $constraint)
}

$variant = $value;
$accessor = PropertyAccess::getPropertyAccessor();
$accessor = PropertyAccess::createPropertyAccessor();

$criteria = array($constraint->property => $accessor->getValue($variant, $constraint->property));
$conflictualVariant = $this->variantRepository->findOneBy($criteria);
Expand Down

0 comments on commit 1b0e233

Please sign in to comment.