0

CGridViewを備えたYiiFrameworkでは、CActiveRecordから値を読み取る必要があります

CGridViewの列定義は列用です。

'columns'=>array(
        ....
        array(
            'name'=>'rel_CustomerCampain.event_comment',
            'header'=>'Commenti Camp.',
            'value'=>'print_r($data->rel_CustomerCampain,false)'
        ),
.....

このオブジェクト$data->rel_CustomerCampainがあり、event_commentの "_attributes:CActiveRecord:private"の下に値を設定する必要があります: * IneedOfThisValue **

'value' =>'$ data->rel_CustomerCampain->event_comment'を試してみると

このエラーが発生しました: 「非オブジェクトのプロパティを取得しようとしています」

誰かが考えを持っていますか?前もって感謝します....

[0] => customerCampain Object
        (
            [_md:CActiveRecord:private] => CActiveRecordMetaData Object
                (
                    [tableSchema] => CMysqlTableSchema Object
                        (
                            [schemaName] => 
                            [name] => tbl_customer_campain
                            [rawName] => `tbl_customer_campain`
                            [primaryKey] => id
                            [sequenceName] => 
                            [foreignKeys] => Array
                                (
                                    [id_campain] => Array
                                        (
                                            [0] => tbl_campain
                                            [1] => id
                                        )

                                    [id_customer] => Array
                                        (
                                            [0] => tbl_customer
                                            [1] => id
                                        )

                                )

                            [columns] => Array
                                (
                                    [id] => CMysqlColumnSchema Object
                                        (
                                            [name] => id
                                            [rawName] => `id`
                                            [allowNull] => 
                                            [dbType] => int(10) unsigned
                                            [type] => string
                                            [defaultValue] => 
                                            [size] => 10
                                            [precision] => 10
                                            [scale] => 
                                            [isPrimaryKey] => 1
                                            [isForeignKey] => 
                                            [autoIncrement] => 1
                                            [_e:CComponent:private] => 
                                            [_m:CComponent:private] => 
                                        )

                                    [id_campain] => CMysqlColumnSchema Object
                                        (
                                            [name] => id_campain
                                            [rawName] => `id_campain`
                                            [allowNull] => 
                                            [dbType] => int(10) unsigned
                                            [type] => string
                                            [defaultValue] => 
                                            [size] => 10
                                            [precision] => 10
                                            [scale] => 
                                            [isPrimaryKey] => 
                                            [isForeignKey] => 1
                                            [autoIncrement] => 
                                            [_e:CComponent:private] => 
                                            [_m:CComponent:private] => 
                                        )

                                    [id_customer] => CMysqlColumnSchema Object
                                        (
                                            [name] => id_customer
                                            [rawName] => `id_customer`
                                            [allowNull] => 
                                            [dbType] => int(10) unsigned
                                            [type] => string
                                            [defaultValue] => 
                                            [size] => 10
                                            [precision] => 10
                                            [scale] => 
                                            [isPrimaryKey] => 
                                            [isForeignKey] => 1
                                            [autoIncrement] => 
                                            [_e:CComponent:private] => 
                                            [_m:CComponent:private] => 
                                        )

                                    [event_datetime] => CMysqlColumnSchema Object
                                        (
                                            [name] => event_datetime
                                            [rawName] => `event_datetime`
                                            [allowNull] => 1
                                            [dbType] => datetime
                                            [type] => string
                                            [defaultValue] => 
                                            [size] => 
                                            [precision] => 
                                            [scale] => 
                                            [isPrimaryKey] => 
                                            [isForeignKey] => 
                                            [autoIncrement] => 
                                            [_e:CComponent:private] => 
                                            [_m:CComponent:private] => 
                                        )

                                    [event_type] => CMysqlColumnSchema Object
                                        (
                                            [name] => event_type
                                            [rawName] => `event_type`
                                            [allowNull] => 1
                                            [dbType] => varchar(200)
                                            [type] => string
                                            [defaultValue] => 
                                            [size] => 200
                                            [precision] => 200
                                            [scale] => 
                                            [isPrimaryKey] => 
                                            [isForeignKey] => 
                                            [autoIncrement] => 
                                            [_e:CComponent:private] => 
                                            [_m:CComponent:private] => 
                                        )

                                    [event_status] => CMysqlColumnSchema Object
                                        (
                                            [name] => event_status
                                            [rawName] => `event_status`
                                            [allowNull] => 1
                                            [dbType] => varchar(200)
                                            [type] => string
                                            [defaultValue] => 
                                            [size] => 200
                                            [precision] => 200
                                            [scale] => 
                                            [isPrimaryKey] => 
                                            [isForeignKey] => 
                                            [autoIncrement] => 
                                            [_e:CComponent:private] => 
                                            [_m:CComponent:private] => 
                                        )

                                    [event_comment] => CMysqlColumnSchema Object
                                        (
                                            [name] => event_comment
                                            [rawName] => `event_comment`
                                            [allowNull] => 1
                                            [dbType] => text
                                            [type] => string
                                            [defaultValue] => 
                                            [size] => 
                                            [precision] => 
                                            [scale] => 
                                            [isPrimaryKey] => 
                                            [isForeignKey] => 
                                            [autoIncrement] => 
                                            [_e:CComponent:private] => 
                                            [_m:CComponent:private] => 
                                        )

                                )

                            [_e:CComponent:private] => 
                            [_m:CComponent:private] => 
                        )

                    [columns] => Array
                        (
                            [id] => CMysqlColumnSchema Object
                                (
                                    [name] => id
                                    [rawName] => `id`
                                    [allowNull] => 
                                    [dbType] => int(10) unsigned
                                    [type] => string
                                    [defaultValue] => 
                                    [size] => 10
                                    [precision] => 10
                                    [scale] => 
                                    [isPrimaryKey] => 1
                                    [isForeignKey] => 
                                    [autoIncrement] => 1
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                            [id_campain] => CMysqlColumnSchema Object
                                (
                                    [name] => id_campain
                                    [rawName] => `id_campain`
                                    [allowNull] => 
                                    [dbType] => int(10) unsigned
                                    [type] => string
                                    [defaultValue] => 
                                    [size] => 10
                                    [precision] => 10
                                    [scale] => 
                                    [isPrimaryKey] => 
                                    [isForeignKey] => 1
                                    [autoIncrement] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                            [id_customer] => CMysqlColumnSchema Object
                                (
                                    [name] => id_customer
                                    [rawName] => `id_customer`
                                    [allowNull] => 
                                    [dbType] => int(10) unsigned
                                    [type] => string
                                    [defaultValue] => 
                                    [size] => 10
                                    [precision] => 10
                                    [scale] => 
                                    [isPrimaryKey] => 
                                    [isForeignKey] => 1
                                    [autoIncrement] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                            [event_datetime] => CMysqlColumnSchema Object
                                (
                                    [name] => event_datetime
                                    [rawName] => `event_datetime`
                                    [allowNull] => 1
                                    [dbType] => datetime
                                    [type] => string
                                    [defaultValue] => 
                                    [size] => 
                                    [precision] => 
                                    [scale] => 
                                    [isPrimaryKey] => 
                                    [isForeignKey] => 
                                    [autoIncrement] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                            [event_type] => CMysqlColumnSchema Object
                                (
                                    [name] => event_type
                                    [rawName] => `event_type`
                                    [allowNull] => 1
                                    [dbType] => varchar(200)
                                    [type] => string
                                    [defaultValue] => 
                                    [size] => 200
                                    [precision] => 200
                                    [scale] => 
                                    [isPrimaryKey] => 
                                    [isForeignKey] => 
                                    [autoIncrement] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                            [event_status] => CMysqlColumnSchema Object
                                (
                                    [name] => event_status
                                    [rawName] => `event_status`
                                    [allowNull] => 1
                                    [dbType] => varchar(200)
                                    [type] => string
                                    [defaultValue] => 
                                    [size] => 200
                                    [precision] => 200
                                    [scale] => 
                                    [isPrimaryKey] => 
                                    [isForeignKey] => 
                                    [autoIncrement] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                            [event_comment] => CMysqlColumnSchema Object
                                (
                                    [name] => event_comment
                                    [rawName] => `event_comment`
                                    [allowNull] => 1
                                    [dbType] => text
                                    [type] => string
                                    [defaultValue] => 
                                    [size] => 
                                    [precision] => 
                                    [scale] => 
                                    [isPrimaryKey] => 
                                    [isForeignKey] => 
                                    [autoIncrement] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                        )

                    [relations] => Array
                        (
                            [relCustomer] => CBelongsToRelation Object
                                (
                                    [joinType] => LEFT OUTER JOIN
                                    [on] => 
                                    [alias] => 
                                    [with] => Array
                                        (
                                        )

                                    [together] => 
                                    [scopes] => 
                                    [name] => relCustomer
                                    [className] => customer
                                    [foreignKey] => id_customer
                                    [select] => *
                                    [condition] => 
                                    [params] => Array
                                        (
                                        )

                                    [group] => 
                                    [join] => 
                                    [having] => 
                                    [order] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                            [idCampain] => CBelongsToRelation Object
                                (
                                    [joinType] => LEFT OUTER JOIN
                                    [on] => 
                                    [alias] => 
                                    [with] => Array
                                        (
                                        )

                                    [together] => 
                                    [scopes] => 
                                    [name] => idCampain
                                    [className] => TblCampain
                                    [foreignKey] => id_campain
                                    [select] => *
                                    [condition] => 
                                    [params] => Array
                                        (
                                        )

                                    [group] => 
                                    [join] => 
                                    [having] => 
                                    [order] => 
                                    [_e:CComponent:private] => 
                                    [_m:CComponent:private] => 
                                )

                        )

                    [attributeDefaults] => Array
                        (
                        )

                    [_model:CActiveRecordMetaData:private] => customerCampain Object
                        (
                            [_md:CActiveRecord:private] => CActiveRecordMetaData Object
 *RECURSION*
                            [_new:CActiveRecord:private] => 
                            [_attributes:CActiveRecord:private] => Array
                                (
                                )

                            [_related:CActiveRecord:private] => Array
                                (
                                )

                            [_c:CActiveRecord:private] => 
                            [_pk:CActiveRecord:private] => 
                            [_alias:CActiveRecord:private] => t
                            [_errors:CModel:private] => Array
                                (
                                )

                            [_validators:CModel:private] => 
                            [_scenario:CModel:private] => 
                            [_e:CComponent:private] => 
                            [_m:CComponent:private] => 
                        )

                )

            [_new:CActiveRecord:private] => 
            [_attributes:CActiveRecord:private] => Array
                (
                    [id] => 2155
                    [id_campain] => 4
                    [id_customer] => 109
                    [event_datetime] => 
                    [event_type] => 
                    [event_status] => 
                    [event_comment] => ******IneedOfThisValue*****
                )

            [_related:CActiveRecord:private] => Array
                (
                )

            [_c:CActiveRecord:private] => 
            [_pk:CActiveRecord:private] => 2155
            [_alias:CActiveRecord:private] => t
            [_errors:CModel:private] => Array
                (
                )

            [_validators:CModel:private] => 
            [_scenario:CModel:private] => update
            [_e:CComponent:private] => 
            [_m:CComponent:private] => 
        )

)
4

1 に答える 1