Does behavior override owner's implementation or just extend it?

This is not stated clearly in the guide.

Do I have to call parent::method() not to lose its functionalities?

Depends, if you want to "do something additional", you must call the base/parent method from the child method. If you want to "do something different", you don't have to call the base/parent method.

class BaseParent {

  function getMessage()

  {

    return 'this is the base message';

  }

}

class ChildExtends extends BaseParent {

function getMessage()

  {

    $baseMsg = BaseParent::getMessage();

    return $baseMsg . '<br />this was extended!';

  }

}

class ChildOverrides extends BaseParent {

function getMessage()

  {

    return 'this was different!';

  }

}

behavior doesn't (can't) override owner's method. behavior mainly enhances owner in two ways: 1. add new methods. 2. respond to events raised in owner.

Thanks Qiang, the term response confused me a little bit. I suppose, owner reacts to events firstly, then behaviors are invoked, right?

eholsinger, thanks for your kindness too, I knew oop basics ;)

The event is raised by owner. behavior attaches its methods to the owner events and thus gets chance to participate in the owner method execution.

As an example, you may check CModel::beforeValidate(). It raises onBeforeValidate event. CModelbehavior may respond to this event.

Perfectly understandable. ;) Guides should be updated accordingly, so others may learn from it before asking.

Thanks for your time and patience.