Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo::getShardKey PHP Method

getShardKey() public method

public getShardKey ( ) : array
return array
    public function getShardKey()
    {
        return $this->shardKey;
    }

Usage Example

 public function testSetShardKeyForClassWithCollPerClassInheritance()
 {
     $cm = new ClassMetadataInfo('stdClass');
     $cm->inheritanceType = ClassMetadataInfo::INHERITANCE_TYPE_COLLECTION_PER_CLASS;
     $cm->setShardKey(array('id' => 'asc'));
     $shardKey = $cm->getShardKey();
     $this->assertEquals(array('id' => 1), $shardKey['keys']);
 }
ClassMetadataInfo