1
0
mirror of synced 2025-02-03 22:09:26 +03:00
Javier Spagnoletti 97cc49033e Updated syntax for ``integer` and `boolean`` types
| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Used short syntax for ```integer``` and ```boolean``` types.

**Before**
```php
/**
 * @var integer
 *
 * @ORM\Column(name="some_integer_field", type="integer")
 */
private $someIntegerField;

/**
 * @var boolean
 *
 * @ORM\Column(name="some_boolean_field", type="boolean")
 */
private $someBooleanField;
```

**After**
```php
/**
 * @var int
 *
 * @ORM\Column(name="some_integer_field", type="integer")
 */
private $someIntegerField;

/**
 * @var bool
 *
 * @ORM\Column(name="some_boolean_field", type="boolean")
 */
private $someBooleanField;
```
2015-07-14 15:30:13 -03:00

63 lines
1.5 KiB
PHP

<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
class DDC144Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
protected function setUp() {
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(array(
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144FlowElement'),
// $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144Expression'),
$this->_em->getClassMetadata(__NAMESPACE__ . '\DDC144Operand'),
));
}
/**
* @group DDC-144
*/
public function testIssue()
{
$operand = new DDC144Operand;
$operand->property = 'flowValue';
$operand->operandProperty = 'operandValue';
$this->_em->persist($operand);
$this->_em->flush();
}
}
/**
* @Entity
* @Table(name="ddc144_flowelements")
* @InheritanceType("JOINED")
* @DiscriminatorColumn(type="string", name="discr")
* @DiscriminatorMap({"flowelement" = "DDC144FlowElement", "operand" = "DDC144Operand"})
*/
class DDC144FlowElement {
/**
* @Id @Column(type="integer") @GeneratedValue
* @var int
*/
public $id;
/** @Column */
public $property;
}
abstract class DDC144Expression extends DDC144FlowElement {
abstract function method();
}
/** @Entity @Table(name="ddc144_operands") */
class DDC144Operand extends DDC144Expression {
/** @Column */
public $operandProperty;
function method() {}
}