ProjectTypesModel.php 908 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. use yii\base\Model;
  5. use app\models\entity\ProjectsLocotech;
  6. use app\models\entity\Tasks;
  7. use app\models\entity\Projecttypes;
  8. /**
  9. * This is the model class for table "s_regions".
  10. *
  11. * The followings are the available columns in table 's_regions':
  12. * @property integer $rg_id
  13. * @property string $rg_name
  14. */
  15. class ProjectTypesModel extends Model
  16. {
  17. public function getActoinData($entity) {
  18. $arrayResult = [];
  19. foreach ($entity as $item) {
  20. $arrayResult[ $item->id ] = $this->FindAction($item->action);
  21. }
  22. return $arrayResult;
  23. }
  24. public function FindAction($actionId)
  25. {
  26. $projectTypesEntity = Projecttypes::findOne($actionId);
  27. if ($projectTypesEntity) {
  28. return $projectTypesEntity;
  29. }
  30. return 0;
  31. }
  32. }