previousStructures_DataGrid::attachRenderer (Previous) (Next) Structures_DataGrid::bindDataSourcenext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Structures_DataGrid::bind

Structures_DataGrid::bind() – シンプルな方法で、レコードセットをデータグリッドにバインドする

Synopsis

require_once 'Structures/DataGrid.php';

bool Structures_DataGrid::bind ( mixed $container , array $options = array() , string $type = = null )

Description

This package is not documented yet.

Parameter

mixed $container

サポートされる任意のデータソース型のレコードセット。

array $options

オプションです。データソースのオプションとして使用されます。

string $type

オプションです。データソースの型です。

Return value

成功した場合に True、それ以外の場合に PEAR_Error を返します。

Throws

例外はスローされません。

SQL クエリのバインド

<?php
// データベース接続を設定します
$options = array('dsn' => 'mysql://user:password@host/db_name');

// 基本的な SQL 文をデータソースとしてバインドします
// 注意: ORDER BY 句や LIMIT 句は自動的に追加されます
$test $datagrid->bind('SELECT * FROM my_table'$options);

// バインド時のエラーを表示します
if (PEAR::isError($test)) {
    echo 
$test->getMessage(); 
}
?>

DB_DataObject のバインド

<?php
$person 
= new DataObjects_Person;

$person->hair 'red';
$person->has_glasses 1

$datagrid->bind($person);
?>

Note

This function can not be called statically.

previousStructures_DataGrid::attachRenderer (Previous) (Next) Structures_DataGrid::bindDataSourcenext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.