/** * Copies the values from current object into passed-in Domain. * * @param Domain $domain Domain to copy values into. */ public function copy(Domain $domain) { $this->defaultValue = $domain->getDefaultValue(); $this->description = $domain->getDescription(); $this->name = $domain->getName(); $this->scale = $domain->getScale(); $this->size = $domain->getSize(); $this->sqlType = $domain->getSqlType(); $this->mappingType = $domain->getType(); }
/** * @dataProvider provideDomainData * */ public function testSetupObject($default, $expression) { $platform = $this->getPlatformMock(); $platform->expects($this->any())->method('getDomainForType')->will($this->returnValue(new Domain('BOOLEAN'))); $domain = new Domain(); $domain->setDatabase($this->getDatabaseMock('bookstore', array('platform' => $platform))); $domain->loadMapping(array('type' => 'BOOLEAN', 'name' => 'foo', 'default' => $default, 'defaultExpr' => $expression, 'size' => 10, 'scale' => 2, 'description' => 'Some description')); $this->assertSame('BOOLEAN', $domain->getType()); $this->assertSame('foo', $domain->getName()); $this->assertInstanceOf('Propel\\Generator\\Model\\ColumnDefaultValue', $domain->getDefaultValue()); $this->assertSame(10, $domain->getSize()); $this->assertSame(2, $domain->getScale()); $this->assertSame('Some description', $domain->getDescription()); }
/** * Returns the default value object for this column. * * @return ColumnDefaultValue * @see Domain::getDefaultValue() */ public function getDefaultValue() { return $this->domain->getDefaultValue(); }