PHP 클래스 OEMigration

(C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011 (C) OpenEyes Foundation, 2011-2013 This file is part of OpenEyes. OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see .
저자: OpenEyes ([email protected])
상속: extends CDbMigration
파일 보기 프로젝트 열기: openeyes/openeyes 1 사용 예제들

공개 메소드들

메소드 설명
createArchiveTable ( $table )
execute ( string $sql, array $params = [], string $message = null ) Executes a SQL statement.
exportData ( $migrationName, $tables )
getCsvFiles ( ) : null | array
getInsertId ( $table )
getInsertReferentialObjectValue ( $object_type, $pointer )
getMigrationPath ( )
initialiseData ( $migrations_path, $update_pk = null, $data_directory = null ) Initialise tables with default data Filenames must to be in the format "nn_tablename.csv", where nn is the processing order FIXME: This needs to be refactored to use SQL rather than relying on models.
setMigrationPath ( $path = null )
setTestData ( $val )
setVerbose ( $verbose = true )

보호된 메소드들

메소드 설명
consolidate ( array $consolidated_migrations ) : boolean
createElementType ( string $event_type, string $name, array $params = [] ) : integer
createOETable ( string $name, array $columns, boolean $versioned = false ) Create a table with the standard OE columns and options.
deleteOEFromMultikeyTable ( string $tableName, array $fieldsValsArray )
dropOETable ( $name, boolean $versioned = false ) Convenience function to drop OE tables from db - versioned defaults to false to mirroe createOETable.
getIdOfElementTypeByClassName ( $className ) : mixed
insertOEElementType ( array $element_types, integer $event_type_id ) : array
insertOEEventType ( $eventTypeName, $eventTypeClass, $eventTypeGroup ) : mixed
versionExistingTable ( string $base_name ) Create a version table for the specified existing OE table.

비공개 메소드들

메소드 설명
compare_file_basenames ( $a, $b )
exportTable ( string $migrationName, CDbTableSchema $table ) : integer
migrationEcho ( $msg )

메소드 상세

consolidate() 보호된 메소드

protected consolidate ( array $consolidated_migrations ) : boolean
$consolidated_migrations array
리턴 boolean

createArchiveTable() 공개 메소드

public createArchiveTable ( $table )

createElementType() 보호된 메소드

protected createElementType ( string $event_type, string $name, array $params = [] ) : integer
$event_type string Class name of event type
$name string Name of event
$params array Supported values and defaults are: class_name, display_order (1), default (false), required (false), parent_name (null)
리턴 integer Element type ID

createOETable() 보호된 메소드

Create a table with the standard OE columns and options.
protected createOETable ( string $name, array $columns, boolean $versioned = false )
$name string
$columns array
$versioned boolean

deleteOEFromMultikeyTable() 보호된 메소드

protected deleteOEFromMultikeyTable ( string $tableName, array $fieldsValsArray )
$tableName string
$fieldsValsArray array example of fieldsValsArray $fieldsValsArray should look like array( array('column_name'=>'value', 'column_name'=>'val'), )

dropOETable() 보호된 메소드

Convenience function to drop OE tables from db - versioned defaults to false to mirroe createOETable.
protected dropOETable ( $name, boolean $versioned = false )
$name
$versioned boolean

execute() 공개 메소드

This method executes the specified SQL statement using {@link dbConnection}.
public execute ( string $sql, array $params = [], string $message = null )
$sql string the SQL statement to be executed
$params array input parameters (name=>value) for the SQL execution. See {@link CDbCommand::execute} for more details.
$message string optional message to display instead of SQL

exportData() 공개 메소드

public exportData ( $migrationName, $tables )

getCsvFiles() 공개 메소드

public getCsvFiles ( ) : null | array
리턴 null | array

getIdOfElementTypeByClassName() 보호된 메소드

protected getIdOfElementTypeByClassName ( $className ) : mixed
$className - string
리턴 mixed - the value of the id. False is returned if there is no value.

getInsertId() 공개 메소드

public getInsertId ( $table )

getInsertReferentialObjectValue() 공개 메소드

public getInsertReferentialObjectValue ( $object_type, $pointer )

getMigrationPath() 공개 메소드

public getMigrationPath ( )

initialiseData() 공개 메소드

Initialise tables with default data Filenames must to be in the format "nn_tablename.csv", where nn is the processing order FIXME: This needs to be refactored to use SQL rather than relying on models.
public initialiseData ( $migrations_path, $update_pk = null, $data_directory = null )

insertOEElementType() 보호된 메소드

protected insertOEElementType ( array $element_types, integer $event_type_id ) : array
$element_types array
$event_type_id integer
리턴 array - list of the element_types ids inserted

insertOEEventType() 보호된 메소드

protected insertOEEventType ( $eventTypeName, $eventTypeClass, $eventTypeGroup ) : mixed
$eventTypeName - string
$eventTypeClass - string
$eventTypeGroup - string
리턴 mixed - the id value of the event_type. False is returned if there is no value.

setMigrationPath() 공개 메소드

public setMigrationPath ( $path = null )

setTestData() 공개 메소드

public setTestData ( $val )

setVerbose() 공개 메소드

public setVerbose ( $verbose = true )

versionExistingTable() 보호된 메소드

Create a version table for the specified existing OE table.
protected versionExistingTable ( string $base_name )
$base_name string Base table name