_property = $property; } /** * Get value that should be validated. Tries to extract value's property if \Magento\Framework\DataObject or * \ArrayAccess or array is passed * * @param mixed $value * @return mixed */ protected function _getValidatorValue($value) { $result = null; if ($value instanceof \Magento\Framework\DataObject) { $result = $value->getDataUsingMethod($this->_property); } elseif ((is_array($value) || $value instanceof \ArrayAccess) && isset($value[$this->_property])) { $result = $value[$this->_property]; } return $result; } /** * Add messages with code of property name * * @param array $messages * @return void */ protected function _addMessages(array $messages) { $this->_messages[$this->_property] = $messages; } }