mytest.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. defined('YII_DEBUG') or define('YII_DEBUG', true);
  3. defined('YII_ENV') or define('YII_ENV', 'dev');
  4. require __DIR__ . '/api/vendor/autoload.php';
  5. require __DIR__ . '/api/vendor/yiisoft/yii2/Yii.php';
  6. $config = require __DIR__ . '/api/config/web.php';
  7. (new yii\web\Application($config));
  8. $res = new app\models\LocomotiveModel();
  9. var_dump(gettype($res));
  10. defined('YII_DEBUG') or define('YII_DEBUG', true);
  11. defined('YII_ENV') or define('YII_ENV', 'dev');
  12. require DIR . '/api/vendor/autoload.php';
  13. require DIR . '/api/vendor/yiisoft/yii2/Yii.php';
  14. $config = require DIR . '/api/config/web.php';
  15. (new yii\web\Application($config));
  16. //if (!$logged_me_in_successfully234)
  17. //return;
  18. /*
  19. $my = 'hello';
  20. exit;
  21. require_once "doctrine/bootstrap.php";
  22. $product = $entityManager->find('Jobtype',0);
  23. die();
  24. foreach ($product->getTasktypesRel()->getValues() as $product) {
  25. var_dump( $product->getName());
  26. }
  27. exit;
  28. $jobtypes = new Jobtypes();
  29. $jobtypes->setName('мойщик окон');
  30. $productRepository = $entityManager->getRepository('Accounts')->findOneBy(['id' => 27 ] );
  31. //var_dump(get_class($productRepository));die();
  32. $jobtypes->addAcoountJobtypes($productRepository);
  33. $entityManager->persist($jobtypes);
  34. $entityManager->flush();
  35. //foreach ($productRepository as $value) {
  36. //}
  37. //$jobtypes = new Jobtypes();
  38. $accounts = new Account();
  39. $id = 1;//$argv[1];
  40. //$product = $entityManager->find('Accounts',1);
  41. // Вывод списка многие ко многим
  42. //$product = $entityManager->find('Jobtypes',21);
  43. $productRepository = $entityManager->getRepository('Section');
  44. $products = $productRepository->findAll();
  45. var_dump(empty($products));
  46. foreach ($products as $product) {
  47. var_dump( $product->getName());
  48. var_dump($product->getLocomotiveSeries());
  49. $ty = $product->getDateStartRepair();
  50. var_dump($ty->getTimestamp());
  51. }
  52. */