Class Ethna_AppObject

Description

アプリケーションオブジェクトのベースクラス

  • author: Masaki Fujimoto <fujimoto@php.net>
  • todo: 複数テーブルの対応
  • access: public

Located in /class/Ethna_AppObject.php (line 21)


	
			
Method Summary
 mixed Ethna_AppObject (object Ethna_Backend &$backend, [mixed $key_type = null], [mixed $key = null], [array $prop = null])
 mixed add ()
 string dump ([string $type = "csv"])
 void exportForm ()
 mixed get (string $key)
 array getDef ()
 mixed getId ()
 mixed getIdDef ()
 string getLongName (string $key)
 string getName (string $key)
 array getNameObject ()
 void importForm ([int $option = null])
 bool isActive ()
 bool isValid ()
 mixed remove ()
 mixed replace ()
 mixed searchId ([array $filter = null], [array $order = null], [int $offset = null], [int $count = null])
 mixed searchProp ([array $keys = null], [array $filter = null], [array $order = null], [int $offset = null], [int $count = null])
 void set (string $key, string $value)
 mixed update ()
 string _dump_csv ()
 void _fieldNameToFormName ( $field_def)
 array _getDBList ()
 array _getPropDef ()
 array _getTableDef ()
 int _setDefault (mixed $key_type, mixed $key)
Methods
Constructor Ethna_AppObject (line 84)

Ethna_AppObjectクラスのコンストラクタ

  • return: 0:正常終了 -1:キー/プロパティ未指定 Ethna_Error:エラー
  • access: public
mixed Ethna_AppObject (object Ethna_Backend &$backend, [mixed $key_type = null], [mixed $key = null], [array $prop = null])
  • object Ethna_Backend &$backend: Ethna_Backendオブジェクト
  • mixed $key_type: 検索キー名
  • mixed $key: 検索キー
  • array $prop: プロパティ一覧
add (line 394)

オブジェクトを追加する

  • return: 0:正常終了 Ethna_Error:エラー
  • access: public
mixed add ()
dump (line 336)

オブジェクトプロパティを指定の形式でダンプする(現在はCSV形式のみサポート)

  • return: ダンプ結果(エラーの場合はnull)
  • access: public
string dump ([string $type = "csv"])
  • string $type: ダンプ形式("csv"...)
exportForm (line 379)

オブジェクトプロパティをフォーム値にエクスポートする

  • access: public
void exportForm ()
get (line 250)

オブジェクトプロパティへのアクセサ(R)

  • return: プロパティ
  • access: public
mixed get (string $key)
  • string $key: プロパティ名
getDef (line 210)

オブジェクトのプロパティ定義を返す

  • return: オブジェクトのプロパティ定義
  • access: public
array getDef ()
getId (line 236)

オブジェクトIDを返す

  • return: オブジェクトID
  • access: public
mixed getId ()
getIdDef (line 223)

プライマリキー定義を返す

  • return: プライマリキーとなるプロパティ名
  • access: public
mixed getIdDef ()
getLongName (line 285)

オブジェクトプロパティ表示名(詳細)へのアクセサ

  • return: プロパティの表示名(詳細)
  • access: public
string getLongName (string $key)
  • string $key: プロパティ名
getName (line 271)

オブジェクトプロパティ表示名へのアクセサ

  • return: プロパティの表示名
  • access: public
string getName (string $key)
  • string $key: プロパティ名
getNameObject (line 298)

プロパティ表示名を格納した連想配列を取得する

  • return: プロパティ表示名を格納した連想配列
  • access: public
array getNameObject ()
importForm (line 354)

フォーム値からオブジェクトプロパティをインポートする

  • access: public
void importForm ([int $option = null])
  • int $option: インポートオプション(OBJECT_IMPORT_IGNORE_NULL,...)
isActive (line 194)

アクティブなオブジェクトかどうかを返す

isValid()メソッドはオブジェクト自体が有効かどうかを判定するのに対し isActive()はオブジェクトがアプリケーションとして有効かどうかを返す

  • return: true:アクティブ false:非アクティブ
  • access: public
bool isActive ()
isValid (line 174)

有効なオブジェクトかどうかを返す

  • return: true:有効 false:無効
  • access: public
bool isValid ()
remove (line 569)

オブジェクトを削除する

  • return: 0:正常終了 Ethna_Error:エラー
  • access: public
mixed remove ()
replace (line 534)

オブジェクトを置換する

MySQLのREPLACE文に相当する動作を行う(add()で重複エラーが発生したら update()を行う)

  • return: 0:正常終了 >0:オブジェクトID(追加時) Ethna_Error:エラー
  • access: public
mixed replace ()
searchId (line 598)

オブジェクトIDを検索する

  • return: array(0 => 検索条件にマッチした件数,
    1. => $offset, $countにより指定された件数のオブジェクトID一覧)
    Ethna_Error:エラー
  • access: public
mixed searchId ([array $filter = null], [array $order = null], [int $offset = null], [int $count = null])
  • array $filter: 検索条件
  • array $order: 検索結果ソート条件
  • int $offset: 検索結果取得オフセット
  • int $count: 検索結果取得数
searchProp (line 650)

オブジェクトプロパティを検索する

  • return: array(0 => 検索条件にマッチした件数,
    1. => $offset, $countにより指定された件数のオブジェクトプロパティ一覧)
    Ethna_Error:エラー
  • access: public
mixed searchProp ([array $keys = null], [array $filter = null], [array $order = null], [int $offset = null], [int $count = null])
  • array $keys: 取得するプロパティ
  • array $filter: 検索条件
  • array $order: 検索結果ソート条件
  • int $offset: 検索結果取得オフセット
  • int $count: 検索結果取得数
set (line 318)

オブジェクトプロパティへのアクセサ(W)

  • access: public
void set (string $key, string $value)
  • string $key: プロパティ名
  • string $value: プロパティ値
update (line 480)

オブジェクトを更新する

  • return: 0:正常終了 Ethna_Error:エラー
  • access: public
mixed update ()
_dump_csv (line 1368)

オブジェクトプロパティをCSV形式でダンプする

  • return: ダンプ結果
  • access: protected
string _dump_csv ()
_fieldNameToFormName (line 1589)

データベースフィールド名に対応するフォーム名を取得する

  • access: protected
void _fieldNameToFormName ( $field_def)
  • $field_def
_getDBList (line 1443)

DBオブジェクト(read only/read-write)を取得する

  • return: array('ro' => {read only db object}, 'rw' => {read-write db object})
  • access: protected
array _getDBList ()
_getPropDef (line 1514)

プロパティ定義を取得する

  • return: プロパティ定義
  • access: protected
array _getPropDef ()
_getTableDef (line 1491)

テーブル定義を取得する

(クラス名→テーブル名のルールを変えたい場合は このメソッドをオーバーライドします)

  • return: テーブル定義
  • access: protected
array _getTableDef ()
_setDefault (line 696)

オブジェクトのアプリケーションデフォルトプロパティを設定する

コンストラクタにより指定されたキーにマッチするエントリがなかった場合の デフォルトプロパティをここで設定することが出来る

  • return: 0:正常終了
  • access: protected
int _setDefault (mixed $key_type, mixed $key)
  • mixed $key_type: 検索キー名
  • mixed $key: 検索キー
_SQLPlugin_SearchPropDef (line 1355)

オブジェクト検索SQLプラグイン(追加条件定義)

sample:

  1.   $search_prop_def array(
  2.     'group_id' => array(
  3.       'primary' => true'key' => true'type' => VAR_TYPE_INT,
  4.       'form_name' => 'group_id''table' => 'group_user_tbl',
  5.     ),
  6.   );
  7.   return $search_prop_def;

  • return: 追加条件定義
  • access: protected
array _SQLPlugin_SearchPropDef ()
_SQLPlugin_SearchTable (line 1331)

オブジェクト検索SQLプラグイン(追加テーブル)

sample:

  1.   return " LEFT JOIN bar_tbl ON foo_tbl.user_id=bar_tbl.user_id";

  • return: テーブルJOINのSQL文
  • access: protected
string _SQLPlugin_SearchTable ()

Documentation generated on Thu, 08 May 2008 00:14:33 +0900 by phpDocumentor 1.4.2