To make relationship between users was created a table that looks like.
sql
CREATE TABLE `friends`(
`from` INT NOT NULL,
`to` INT NOT NULL,
UNIQUE INDEX(`
You should check out this section of the documentation:
http://kohanaframework.org/guide/orm/relationships#hasmany
You'll need something like this within your user class
protected $_has_many = array(
'friends' => array(
'model' => 'user',
'through' => 'friends',
'far_key' => 'from',
'foreign_key' => 'to',
)
);
These options are used at this part in the source code.