Skip to content

Instantly share code, notes, and snippets.

@martinlipp
Created January 22, 2016 05:50
Show Gist options
  • Save martinlipp/da5302504e9970f15a51 to your computer and use it in GitHub Desktop.
Save martinlipp/da5302504e9970f15a51 to your computer and use it in GitHub Desktop.
88a89
>
91c92,104
< $checked = in_array($valueAttribute, $propertyValue);
---
> foreach ($propertyValue as $value) {
> if (is_object($value)) {
> $identifier = $this->persistenceManager->getIdentifierByObject($value);
> if ($identifier !== NULL) {
> $value = $identifier;
> }
> }
> // Not quite sure if identical or equal operator here; in_array did not use strict version
> if ($valueAttribute === $value) {
> $checked = TRUE;
> break;
> }
> }
112a126,139
>
> /**
> * Get the name of this form element, without prefix.
> *
> * This is done to prevent the extra __identity being added for objects
> * since it leading to property mapping errors and it works without it.
> *
> * @return string name
> */
> protected function getNameWithoutPrefix()
> {
> $name = parent::getNameWithoutPrefix();
> return str_replace('[__identity]', '', $name);
> }
114d140
<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment