cakePHP get self hasMany array
- by openprojdevel
I have an table with fields like:
empid,empname,empcode,department_id ...
I need an array like
[Model]
-------[department_id 1]
--------------[0]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
--------------[1]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
--------------[2]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
-------[department_id 2]
--------------[0]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
--------------[1]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
--------------[2]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
-------[department_id 3]
--------------[0]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
--------------[1]
--------------------[empid]
--------------------[empname]
--------------------[empcode]
Regards,