src/ORM/FieldType/DBString.php
public function LimitWordCount($numWords = 26, $add = '...')
    {
        $value = $this->Plain();
        $words = explode(' ', $value);
        if (count($words) <= $numWords) {
            return $value;
        }

        // Limit
        $words = array_slice($words, 0, $numWords);
        return implode(' ', $words) . $add;
    }
public function LimitWordCount($numWords = 26, $add = '...')
    {
        $value = $this->Plain();
        $words = explode(' ', $value);
        if (count($words) <= $numWords) {
            return $value;
        }

        // Limit
        $words = array_slice($words, 0, $numWords);
        return implode(' ', $words) . $add;
    }
public function LimitWordCount ( $ numWords = 26 , $ add = '...' ) { $ value = $ this -> Plain ( ) ; $ words = explode ( ' ' , $ value ) ; if ( count ( $ words ) <= $ numWords ) { return $ value ; } // Limit $ words = array_slice ( $ words , 0 , $ numWords ) ; return implode ( ' ' , $ words ) . $ add ; }
Limit this field's content by a number of words.

@param int $numWords Number of words to limit by.
@param string $add Ellipsis to add to the end of truncated string.

@return string
Limit this field s content by a number of words .