protected function populateItem($row)
    {
        $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();

        if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {
            $data = null;
        }

        return new $class([
            'name' => $row['name'],
            'type' => $row['type'],
            'description' => $row['description'],
            'ruleName' => $row['rule_name'],
            'data' => $data,
            'createdAt' => $row['created_at'],
            'updatedAt' => $row['updated_at'],
            'parents' => isset($row['parents']) ? $row['parents'] : null,
        ]);
    }
protected function populateItem($row)
    {
        $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();

        if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {
            $data = null;
        }

        return new $class([
            'name' => $row['name'],
            'type' => $row['type'],
            'description' => $row['description'],
            'ruleName' => $row['rule_name'],
            'data' => $data,
            'createdAt' => $row['created_at'],
            'updatedAt' => $row['updated_at'],
            'parents' => isset($row['parents']) ? $row['parents'] : null,
        ]);
    }
protected function populateItem ( $ row ) { $ class = $ row [ 'type' ] == Item :: TYPE_PERMISSION ? Permission :: className ( ) : Role :: className ( ) ; if ( ! isset ( $ row [ 'data' ] ) || ( $ data = @ unserialize ( $ row [ 'data' ] ) ) === false ) { $ data = null ; } return new $ class ( [ 'name' => $ row [ 'name' ] , 'type' => $ row [ 'type' ] , 'description' => $ row [ 'description' ] , 'ruleName' => $ row [ 'rule_name' ] , 'data' => $ data , 'createdAt' => $ row [ 'created_at' ] , 'updatedAt' => $ row [ 'updated_at' ] , 'parents' => isset ( $ row [ 'parents' ] ) ? $ row [ 'parents' ] : null , ] ) ; }
Populates an auth item with the data fetched from collection
@param array $row the data from the auth item collection
@return Item the populated auth item instance (either Role or Permission)
Populates an auth item with the data fetched from collection