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

isSharded() public method

Checks whether this document has shard key or not.
public isSharded ( ) : boolean
return boolean
    public function isSharded()
    {
        return $this->shardKey ? true : false;
    }

Usage Example

 public function testIsShardedIfThereIsAShardKey()
 {
     $cm = new ClassMetadataInfo('stdClass');
     $cm->setShardKey(array('id' => 'asc'));
     $this->assertTrue($cm->isSharded());
 }
ClassMetadataInfo