are you sure $this->associationMapping is always defined and an array? otherwise you would need to do ``if ($this->associationMapping && isset($this->associationMapping['targetDocument'])) ``