protected function getDateTimeClass(Column $column) { if (PropelTypes::isPhpObjectType($column->getPhpType())) { return $column->getPhpType(); } $dateTimeClass = $this->getBuildProperty('generator.dateTime.dateTimeClass'); if (!$dateTimeClass) { $dateTimeClass = '\\DateTime'; } return $dateTimeClass; }
/** * Adds the comment for a mutator * @param string &$script The script will be modified in this method. * @param Column $col The current column. * @see addMutatorOpen() **/ public function addMutatorComment(&$script, Column $col) { $clo = strtolower($col->getName()); $script .= "\n /**\n * Set the value of [{$clo}] column.\n * " . $col->getDescription() . "\n * @param " . $col->getPhpType() . " \$v new value\n * @return " . $this->getObjectClassname() . " The current object (for fluent API support)\n */"; }
/** * Adds the comment for a mutator. * * @param string &$script * @param Column $column */ public function addMutatorComment(&$script, Column $column) { $clo = $column->getLowercasedName(); $script .= "\n /**\n * Set the value of [{$clo}] column.\n * " . $column->getDescription() . "\n * @param " . $column->getPhpType() . " \$v new value\n * @return \$this|" . $this->getObjectClassName(true) . " The current object (for fluent API support)\n */"; }
/** * @dataProvider provideMappingTextTypes */ public function testTextType($mappingType) { $domain = $this->getDomainMock(); $domain->expects($this->once())->method('setType')->with($this->equalTo($mappingType)); $domain->expects($this->any())->method('getType')->will($this->returnValue($mappingType)); $column = new Column(); $column->setDomain($domain); $column->setType($mappingType); $this->assertSame('string', $column->getPhpType()); $this->assertTrue($column->isPhpPrimitiveType()); $this->assertTrue($column->isTextType()); }