plugin/exo/Entity/Misc/Cell.php
public function setChoices(array $choices)
    {
        // Removes old choices
        $oldChoices = array_filter($this->choices->toArray(), function (CellChoice $choice) use ($choices) {
            return !in_array($choice, $choices);
        });
        array_walk($oldChoices, function (CellChoice $choice) {
            $this->removeChoice($choice);
        });

        // Adds new ones
        array_walk($choices, function (CellChoice $choice) {
            $this->addChoice($choice);
        });
    }
public function setChoices(array $choices)
    {
        // Removes old choices
        $oldChoices = array_filter($this->choices->toArray(), function (CellChoice $choice) use ($choices) {
            return !in_array($choice, $choices);
        });
        array_walk($oldChoices, function (CellChoice $choice) {
            $this->removeChoice($choice);
        });

        // Adds new ones
        array_walk($choices, function (CellChoice $choice) {
            $this->addChoice($choice);
        });
    }
public function setChoices ( array $ choices ) { // Removes old choices $ oldChoices = array_filter ( $ this -> choices -> toArray ( ) , function ( CellChoice $ choice ) use ( $ choices ) { return ! in_array ( $ choice , $ choices ) ; } ) ; array_walk ( $ oldChoices , function ( CellChoice $ choice ) { $ this -> removeChoice ( $ choice ) ; } ) ; // Adds new ones array_walk ( $ choices , function ( CellChoice $ choice ) { $ this -> addChoice ( $ choice ) ; } ) ; }
Sets choices collection.

@param array $choices
Sets choices collection .