Esempio n. 1
0
 /**
  * Created a kit
  *
  * @param Product $product
  * @param Task    $task
  * @param string  $comments
  *
  * @return Kit
  */
 public static function create(Product $product, Task $task = null, $comments = '')
 {
     $kit = new Kit();
     $kit->setProduct($product)->setTask($task)->save();
     if (($comments = trim($comments)) === '') {
         $kit->addComment($comments);
     }
     return $kit;
 }