protected function evaluateForContentCreateStruct(APILimitationValue $value, array $targets = null) { // If targets is empty/null return false as user does not have access // to content w/o location with this limitation if (empty($targets)) { return false; } foreach ($targets as $target) { if (!$target instanceof LocationCreateStruct) { throw new InvalidArgumentException('$targets', 'If $object is ContentCreateStruct must contain objects of type: LocationCreateStruct'); } // For ContentCreateStruct all placements must match if (!in_array($target->parentLocationId, $value->limitationValues)) { return false; } } return true; }