Sleimanx2\Plastic\Map\Blueprint::tokenCount PHP Метод

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

Add a completion field to the map.
public tokenCount ( string $field, array $attributes = [] ) : Illuminate\Support\Fluent
$field string
$attributes array
Результат Illuminate\Support\Fluent
    public function tokenCount($field, $attributes = [])
    {
        return $this->addField('token_count', $field, $attributes);
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function it_adds_a_token_count_map()
 {
     $blueprint = new Blueprint('post');
     $blueprint->create();
     $blueprint->tokenCount('token');
     $statement = $blueprint->toDSL($this->getGrammar());
     $this->assertEquals(['token' => ['type' => 'token_count']], $statement);
 }