Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $a = new task();
- $a->title = 'hello world';
- $a->save()
- Now I would like $a to be realated to the tasktype, a person who made this, and a department.
- Rather than doing:
- $tasktype = new Tasktype();
- $tasktype->where(id,12)->get();
- $person = new Person();
- $person->where(id,2)->get();
- $a->save($tasktype, $person->all);
- Could perhaps do something like:
- $relateto = array(
- 'person', 2,
- 'tasktype', 12
- )
- $a->saverelations($relateto);
- Thoughts?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement