Doctrine\OXM\Mapping\ClassMetadataInfo::isDirect PHP Метод

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

public isDirect ( $fieldName ) : boolean
Результат boolean
    public function isDirect($fieldName)
    {
        if (!isset($this->fieldMappings[$fieldName])) {
            throw MappingException::mappingNotFound($this->name, $fieldName);
        }
        return $this->fieldMappings[$fieldName]['direct'] ? true : false;
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function itShouldMapProperly()
 {
     $class = new ClassMetadataInfo('Doctrine\\Tests\\OXM\\Mapping\\Entity');
     $this->assertEquals('Doctrine\\Tests\\OXM\\Mapping\\Entity', $class->getName());
     $class->mapField(array('fieldName' => 'squibble', 'type' => 'string', 'required' => true, 'direct' => true, 'id' => true, 'collection' => false, 'nullable' => false, 'getMethod' => 'getSquibble', 'setMethod' => 'setSquibble'));
     $this->assertTrue($class->hasField('squibble'));
     $this->assertEquals('string', $class->getTypeOfField('squibble'));
     $this->assertTrue($class->isRequired('squibble'));
     $this->assertTrue($class->isDirect('squibble'));
     $this->assertFalse($class->isCollection('squibble'));
     $this->assertFalse($class->isNullable('squibble'));
 }