Question

I am working with RedBeansPHP 3.3 and have the following PHP object created by RedBeans findOne called $result:

RedBean_OODBBean Object
(
    [null:RedBean_OODBBean:private] => 
    [properties:RedBean_OODBBean:private] => Array
        (
            [id] => 10
            [datetime] => 2013-02-10 10:17:43
            [ip] => 68.32.52.219
            [vcode] => 6780-QBDY
            [roll1] => 7
            [roll2] => 8
            [roll3] => 10
            [roll4] => 6
            [roll5] => 1
            [roll6] => 4
            [roll7] => 2
            [roll8] => 4
            [roll9] => 2
            [roll10] => 8
        )

    [__info:RedBean_OODBBean:private] => Array
        (
            [type] => dice
            [sys.id] => id
            [tainted] => 
            [sys.orig] => Array
                (
                    [id] => 10
                    [datetime] => 2013-02-10 10:17:43
                    [ip] => 68.32.52.219
                    [vcode] => 6780-QBDY
                    [roll1] => 7
                    [roll2] => 8
                    [roll3] => 10
                    [roll4] => 6
                    [roll5] => 1
                    [roll6] => 4
                    [roll7] => 2
                    [roll8] => 4
                    [roll9] => 2
                    [roll10] => 8
                )

        )

    [beanHelper:RedBean_OODBBean:private] => RedBean_BeanHelper_Facade Object
        (
        )

    [fetchType:RedBean_OODBBean:private] => 
    [withSql:RedBean_OODBBean:private] => 
    [aliasName:RedBean_OODBBean:private] => 
)

I want to access the value [type] => dice in the second array. What is the PHP syntax for that?

$result->???????->type [Am I close?]

Thanks!

Was it helpful?

Solution

Wanted anyone to know who was searching for an answer that I got it from the RedBeans creator.

You can access a RedBeans type by saying:

$beanTable = $bean->getMeta('type');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top