I have the following code:
print_r( $this->request->data['User'] ['username'] );
print_r( $this->User->findByRole($this->request->data['User']['username']) );
Now as you can see this is just to test it but when i try to run this i get the username correctly ( the first print_r) but the second print_r returns an empty array.
I know that there is a field called Role in my user database i also know that it is not empty. it should return employee.
So what am i doing wrong?
findByRole. i.e. You are searching therolecolumn with theusernamevalue. You want to return therolefield, notfindByit