コード例 #1
0
 /**
  * 
  * @return string
  * @throws \Exception Raises exception if engine is not supported
  */
 private function FindEngineFolder()
 {
     $bundle = $this->manifest->BundleName();
     $sqlFolder = PathUtil::InstallationSqlFolder($bundle);
     if (!Folder::Exists($sqlFolder) || Folder::IsEmpty($sqlFolder)) {
         return '';
     }
     $engine = (string) $this->connection->Engine();
     $engineFolder = Path::Combine($sqlFolder, $engine);
     if (!Folder::Exists($engineFolder)) {
         throw new \Exception("Bundle {$bundle} doesn't support your database engine '{$engine}'");
     }
     return $engineFolder;
 }
コード例 #2
0
 private function AddSetter(Php\Writer $writer, $table, $field)
 {
     $fieldInfo = $this->connection->GetFieldInfo($table, $field);
     $keyInfo = $fieldInfo->KeyInfo();
     //No setter for primary key!
     if ($keyInfo && $keyInfo->IsPrimary()) {
         return;
     }
     $class = $this->ClassName($table);
     $type = $this->GetValueTypeName($table, $field);
     $writer->StartDocComment();
     $writer->AddDocComment('Sets the ' . $this->GetNiceName($field) . ' of the ' . $this->GetNiceName($class) . '.');
     $writer->AddDocComment($type . ' $value', 'param');
     $writer->EndDocComment();
     $param = $this->GetValueParam($type, $fieldInfo->IsNullable());
     $writer->StartFunction('final function Set' . $field, array($param));
     $writer->AddCommand('$this->' . $field . ' = $value');
     $writer->EndFunction();
 }
コード例 #3
0
ファイル: Object.php プロジェクト: agentmedia/phine-framework
 protected function __construct(DBInterfaces\IDatabaseConnection $connection)
 {
     $this->connection = $connection;
     $this->escaper = $connection->GetEscaper();
     $this->sqlLimiter = $connection->GetSqlLimiter();
 }