/** * Creates a IValueHolder instance for a given combination of IField and raw value. * * @param IField $field * @param mixed $raw_value * * @return IValueHolder */ protected function createValueHolder(IField $field, $raw_value) { $value_holder = $field->createValueHolder($raw_value); if ($value_holder instanceof AggregateValueHolder) { // Listen to all changes made to AggregateValueHolder instances corresponding to our related fields // and propagte those changes to our listeners such as the ValuesHolder parent document. $value_holder->addAggregateChangedListener($this); } return $value_holder; }