コード例 #1
0
 /**
  *	Create Method
  *
  *	Returns a type object based on the options given.
  *	@param Frozensheep\Synthesize\Type\SynthesizeOption $objOptions The options object.
  *	return object The object for the type created.
  */
 public static function create(SynthesizeOption $objOptions)
 {
     $strType = TypeFactory::getType($objOptions->type);
     if (!class_exists($strType)) {
         throw new UnknownTypeException($strType);
     }
     $objObject = new $strType(null, $objOptions);
     return $objObject;
 }
コード例 #2
0
ファイル: Synthesize.php プロジェクト: frozensheep/synthesize
 /**
  *	Create Method
  *
  *	Used internally to create the object used to store the data type.
  *	@param \Frozensheep\Synthesize\Type\SynthesizeOption $objOption The options about what data object is required.
  *	@return object
  *
  */
 private function _create(SynthesizeOption $objOption)
 {
     return TypeFactory::create($objOption);
 }
コード例 #3
0
 public function testCreateFakeType()
 {
     $objSynthesizeOptions = new SynthesizeOption(array('type' => 'fake'));
     $this->setExpectedException('Frozensheep\\Synthesize\\Exception\\UnknownTypeException');
     $objType = TypeFactory::create($objSynthesizeOptions);
 }