Elastica\Type\Mapping::setType PHP Method

setType() public method

..
public setType ( Type $type )
$type Elastica\Type Type object
    public function setType(Type $type)
    {
        $this->_type = $type;
        return $this;
    }

Usage Example

Example #1
0
 public function postInstall(RecordInterface $record)
 {
     $client = new Client(array('host' => $this->registry['search.host'], 'port' => $this->registry['search.port']));
     $index = $client->getIndex('amun');
     $index->create();
     $type = $index->getType('page');
     $mapping = new Mapping();
     $mapping->setType($type);
     $mapping->setProperties(array('id' => array('type' => 'string', 'include_in_all' => false), 'userId' => array('type' => 'integer', 'include_in_all' => false), 'path' => array('type' => 'string', 'include_in_all' => true), 'title' => array('type' => 'string', 'include_in_all' => true), 'content' => array('type' => 'string', 'include_in_all' => true), 'date' => array('type' => 'date', 'include_in_all' => false)));
     $mapping->send();
 }
All Usage Examples Of Elastica\Type\Mapping::setType