🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# Class Phalcon\\Validation\\Message\\Group # Class **Phalcon\\Validation\\Message\\Group** *implements* Countable, ArrayAccess, Iterator, Traversable Represents a group of validation messages ### Methods public **\_\_construct** (\[*array* $messages\]) Phalcon\\Validation\\Message\\Group constructor public [*Phalcon\\Validation\\Message*](#)**offsetGet** (*int* $index) Gets an attribute a message using the array syntax ``` <pre class="calibre14">``` <?php print_r($messages[0]); ``` ``` public **offsetSet** (*int* $index, [*Phalcon\\Validation\\Message*](#) $message) Sets an attribute using the array-syntax ``` <pre class="calibre14">``` <?php $messages[0] = new \Phalcon\Validation\Message('This is a message'); ``` ``` public *boolean***offsetExists** (*int* $index) Checks if an index exists ``` <pre class="calibre14">``` <?php var_dump(isset($message['database'])); ``` ``` public **offsetUnset** (*string* $index) Removes a message from the list ``` <pre class="calibre14">``` <?php unset($message['database']); ``` ``` public **appendMessage** (*unknown* $message) Appends a message to the group ``` <pre class="calibre14">``` <?php $messages->appendMessage(new \Phalcon\Validation\Message('This is a message')); ``` ``` public **appendMessages** (*Phalcon\\Validation\\MessageInterface\[\]* $messages) Appends an array of messages to the group ``` <pre class="calibre14">``` <?php $messages->appendMessages($messagesArray); ``` ``` public *array***filter** (*string* $fieldName) Filters the message group by field name public **count** () Returns the number of messages in the list public **rewind** () Rewinds the internal iterator public [*Phalcon\\Validation\\Message*](#)**current** () Returns the current message in the iterator public **key** () Returns the current position/key in the iterator public **next** () Moves the internal iteration pointer to the next position public **valid** () Check if the current message in the iterator is valid public static <a class="calibre6 pcalibre1" href="">*Phalcon\\Validation\\Message\\Group*</a>**\_\_set\_state** (*array* $group) Magic \_\_set\_state helps to re-build messages variable when exporting | - [索引](# "总目录") - [下一页](# "Abstract class Phalcon\Validation\Validator") | - [上一页](# "Class Phalcon\Validation\Message") | - [API Indice](#) »