Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00015 final class DaoBuilder extends OnceBuilder
00016 {
00017 public static function build(MetaClass $class)
00018 {
00019 $out = self::getHead();
00020
00021 $type = $class->getType();
00022
00023 if ($type) {
00024 switch ($type->getId()) {
00025
00026 case MetaClassType::CLASS_ABSTRACT:
00027
00028 $abstract = 'abstract ';
00029 $notes = 'nothing here yet';
00030
00031 break;
00032
00033 case MetaClassType::CLASS_FINAL:
00034
00035 $abstract = 'final ';
00036 $notes = 'last chance for customization';
00037
00038 break;
00039
00040 default:
00041
00042 throw new WrongStateException('unknown class type');
00043 }
00044 } else {
00045 $abstract = null;
00046 $notes = 'your brilliant stuff goes here';
00047 }
00048
00049 $out .= <<<EOT
00050 {$abstract}class {$class->getName()}DAO extends Auto{$class->getName()}DAO
00051 {
00052
00053 }
00054
00055 EOT;
00056
00057 return $out.self::getHeel();
00058 }
00059 }
00060 ?>