FriendshipsController
extends AppController
in package
Friendships Controller Manages user connections, friend requests, and friend lists.
Table of Contents
Properties
Methods
- accept() : Response|null
- Accept method Accepts a pending friend request.
- add() : Response|null
- Add method Sends a friend request to another user.
- beforeRender() : mixed
- delete() : Response|null
- Delete method Removes an existing friend.
- index() : Response|null|void
- Index method Displays the friend list, pending requests, and user search functionality.
- initialize() : void
- Initialization hook method.
- reject() : Response|null
- Reject method Rejects a pending friend request.
- view() : Response|null|void
- View method Displays details of a specific friendship.
Properties
$Friendships
public
FriendshipsTable
$Friendships
Methods
accept()
Accept method Accepts a pending friend request.
public
accept([string|null $id = null ]) : Response|null
Parameters
- $id : string|null = null
-
Friendship id.
Return values
Response|null —Redirects to index.
add()
Add method Sends a friend request to another user.
public
add([string|null $friendId = null ]) : Response|null
Parameters
- $friendId : string|null = null
-
Friend user id.
Return values
Response|null —Redirects on success.
beforeRender()
public
beforeRender(EventInterface $event) : mixed
Parameters
- $event : EventInterface
delete()
Delete method Removes an existing friend.
public
delete([string|null $id = null ]) : Response|null
Parameters
- $id : string|null = null
-
Friendship id.
Tags
Return values
Response|null —Redirects to index.
index()
Index method Displays the friend list, pending requests, and user search functionality.
public
index() : Response|null|void
Return values
Response|null|void —Renders view
initialize()
Initialization hook method.
public
initialize() : void
Use this method to add common initialization code like loading components.
e.g. $this->loadComponent('FormProtection');
reject()
Reject method Rejects a pending friend request.
public
reject([string|null $id = null ]) : Response|null
Parameters
- $id : string|null = null
-
Friendship id.
Return values
Response|null —Redirects to index.
view()
View method Displays details of a specific friendship.
public
view([string|null $id = null ]) : Response|null|void
Parameters
- $id : string|null = null
-
Friendship id.
Tags
Return values
Response|null|void —Renders view