Yii Framework Forum: Column Alias For Ar - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Column Alias For Ar Rate Topic: -----

#1 User is offline   klammeraffe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 07-September 12
  • Location:Berlin, Germany

Posted 31 January 2013 - 06:34 AM

Hey,

I installed an extension (user-management) and it assumes certain table column names. Mine are partly different. Is there something like table column aliases?

That would be great, since than I don't need to change the extension nor my own code a lot.
0

#2 User is offline   Imre 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 30-March 11

Posted 31 January 2013 - 10:47 AM

try adding getters/setters for required fields.

i.e

class User 
{
    public function getUsername() {
        return $this->user_name;
    }

    public function setUsername($username) {
        $this->user_name = $username;
    }
}

1

#3 User is offline   klammeraffe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 07-September 12
  • Location:Berlin, Germany

Posted 31 January 2013 - 10:51 AM

View PostImre, on 31 January 2013 - 10:47 AM, said:


class User 
{
    public function getUsername() {
        return $this->user_name;
    }

    public function setUsername($username) {
        $this->user_name = $username;
    }
}


This works! Thank you
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users