entityName = $entityName; // Split serialization groups string into array. $serializationGroups = explode(',', $serializationGroups); // Trim values and remove empty. $serializationGroups = array_filter( array_map('trim', $serializationGroups) ); $this->serializationGroups = $serializationGroups; } /** * @param mixed $value Value to match. * * @return boolean */ public function match($value) { // Get entity metadata for specified entity. $metadata = AppMatcher::getEntityMetadata($this->entityName); // Get patter fot specified entity with given serialization group. $pattern = $metadata->getPattern($this->serializationGroups); if ($pattern && ! AppMatcher::match($value, $pattern, $this->error)) { $this->error = "Invalid entity {$this->entityName}: {$this->error}"; return false; } return true; } }