本文整理匯總了PHP中Doctrine\ORM\Query\ResultSetMapping::isScalarResult方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResultSetMapping::isScalarResult方法的具體用法?PHP ResultSetMapping::isScalarResult怎麽用?PHP ResultSetMapping::isScalarResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\ORM\Query\ResultSetMapping
的用法示例。
在下文中一共展示了ResultSetMapping::isScalarResult方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testBasicResultSetMapping
/**
* For SQL: SELECT id, status, username, name FROM cms_users
*/
public function testBasicResultSetMapping()
{
$this->_rsm->addEntityResult('Doctrine\\Tests\\Models\\CMS\\CmsUser', 'u');
$this->_rsm->addFieldResult('u', 'id', 'id');
$this->_rsm->addFieldResult('u', 'status', 'status');
$this->_rsm->addFieldResult('u', 'username', 'username');
$this->_rsm->addFieldResult('u', 'name', 'name');
$this->assertFalse($this->_rsm->isScalarResult('id'));
$this->assertFalse($this->_rsm->isScalarResult('status'));
$this->assertFalse($this->_rsm->isScalarResult('username'));
$this->assertFalse($this->_rsm->isScalarResult('name'));
$this->assertTrue($this->_rsm->getClassName('u') == 'Doctrine\\Tests\\Models\\CMS\\CmsUser');
$class = $this->_rsm->getDeclaringClass('id');
$this->assertTrue($class == 'Doctrine\\Tests\\Models\\CMS\\CmsUser');
$this->assertEquals('u', $this->_rsm->getEntityAlias('id'));
$this->assertEquals('u', $this->_rsm->getEntityAlias('status'));
$this->assertEquals('u', $this->_rsm->getEntityAlias('username'));
$this->assertEquals('u', $this->_rsm->getEntityAlias('name'));
$this->assertEquals('id', $this->_rsm->getFieldName('id'));
$this->assertEquals('status', $this->_rsm->getFieldName('status'));
$this->assertEquals('username', $this->_rsm->getFieldName('username'));
$this->assertEquals('name', $this->_rsm->getFieldName('name'));
}