Prado\Collections\TListItemCollection::findIndexByText PHP Метод

findIndexByText() публичный Метод

Finds the lowest cardinal index of the item whose text is the one being looked for.
public findIndexByText ( $text, $includeDisabled = true ) : integer
Результат integer the index of the item found, -1 if not found.
    public function findIndexByText($text, $includeDisabled = true)
    {
        $text = TPropertyValue::ensureString($text);
        $index = 0;
        foreach ($this as $item) {
            if ($item->getText() === $text && ($includeDisabled || $item->getEnabled())) {
                return $index;
            }
            $index++;
        }
        return -1;
    }