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