コード例 #1
0
ファイル: ObjectBuilder.php プロジェクト: SwissalpS/Propel2
 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;
 }
コード例 #2
0
ファイル: ObjectBuilder.php プロジェクト: rouffj/Propel2
 /**
  * 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     */";
 }
コード例 #3
0
 /**
  * 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     */";
 }
コード例 #4
0
 /**
  * @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());
 }