standards - Yii: default generation of tasks after the creation of a new project -


The projects and work in my application I have, and I want to go (as a simple example) that make a project After, two tasks will be prepared by default and this project will be assigned.

Work for all projects is in the beginning, then it is possible to update the job for a single project ...

For example:

< p> I'm making Project_A - & gt; Building Work 1, Work 2

I'm making Project_B - & gt; Working 1, Work 2

Is this possible?

Keep the function Project.php model file:

  Save the first public function () {// Create two tasks and save them to get the auto-increment key Save the database $ task1 = new task; $ Task1- & gt; Save (); $ Task 2 = new task; $ Task2- & gt; Save (); // $ This refers to the current project / Believe that we have two fields that have ID = $ of functions- to this- & gt; task1 = $ task1- & gt; primary key; $ This- & gt; Task 2 = $ Task 2- & gt; Primer; Return parent: First save (); }    

Comments

Popular posts from this blog

php - How can I cram 6+31 numeric characters into 22 alphanumeric characters? -

mysql - where clause in inner join query -

java - Why my included JSP file won't get processed correctly? -