public function getHTML(Property $property, Specification $specification) { $value = $specification->getAttribute('value'); $arr = []; foreach ($property->getDefaultValues() as $defaultValue) { if (in_array($defaultValue->getId(), $value)) { $arr[] = $defaultValue->getName(); } } echo implode(', ', $arr); }
public function getHTML(Property $property, Specification $specification) { $out = ''; $value = $specification->getAttribute('value'); foreach ($property->getDefaultValues() as $defaultValue) { if ($defaultValue->getId() == $value) { $out .= $defaultValue->getName(); break; } } echo $out; }
/** * Validate whether given data is mongoID. * * @param mixed $nodeData * * @return bool */ public function isValid($nodeData) { $isValid = true; if (!is_array($nodeData)) { $isValid = false; } else { $property = new Property(); foreach ($nodeData as $value) { if ($value instanceof ObjectID === false) { $isValid = false; $this->setErrorDescription('One element of the array is not the instance of MongoId'); break; } if ($property->existsInCollection($value) === false) { $this->setErrorDescription('One element of the array is absent in property collection'); $isValid = false; break; } } } return $isValid; }