public function mapRole(array $data)
    {
        $role = new Role();

        foreach ($data as $row) {
            if (empty($role->id)) {
                $role->id = (int)$row['ezrole_id'];
                $role->identifier = $row['ezrole_name'];
                $role->status = $row['ezrole_version'] != 0 ? Role::STATUS_DRAFT : Role::STATUS_DEFINED;
                $role->originalId = $row['ezrole_version'] ? (int)$row['ezrole_version'] : Role::STATUS_DEFINED;
                // skip name and description as they don't exist in legacy
            }
        }

        $role->policies = $this->mapPolicies($data);

        return $role;
    }
public function mapRole(array $data)
    {
        $role = new Role();

        foreach ($data as $row) {
            if (empty($role->id)) {
                $role->id = (int)$row['ezrole_id'];
                $role->identifier = $row['ezrole_name'];
                $role->status = $row['ezrole_version'] != 0 ? Role::STATUS_DRAFT : Role::STATUS_DEFINED;
                $role->originalId = $row['ezrole_version'] ? (int)$row['ezrole_version'] : Role::STATUS_DEFINED;
                // skip name and description as they don't exist in legacy
            }
        }

        $role->policies = $this->mapPolicies($data);

        return $role;
    }
public function mapRole ( array $ data ) { $ role = new Role ( ) ; foreach ( $ data as $ row ) { if ( empty ( $ role -> id ) ) { $ role -> id = ( int ) $ row [ 'ezrole_id' ] ; $ role -> identifier = $ row [ 'ezrole_name' ] ; $ role -> status = $ row [ 'ezrole_version' ] != 0 ? Role :: STATUS_DRAFT : Role :: STATUS_DEFINED ; $ role -> originalId = $ row [ 'ezrole_version' ] ? ( int ) $ row [ 'ezrole_version' ] : Role :: STATUS_DEFINED ; // skip name and description as they don't exist in legacy } } $ role -> policies = $ this -> mapPolicies ( $ data ) ; return $ role ; }
Map role data to a role.

@param array $data

@return \eZ\Publish\SPI\Persistence\User\Role
Map role data to a role .