CcSubjs.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Skeleton subclass for representing a row from the 'cc_subjs' table.
  4. *
  5. *
  6. *
  7. * You should add additional methods to this class to meet the
  8. * application requirements. This class will only be generated as
  9. * long as it does not already exist in the output directory.
  10. *
  11. * @package propel.generator.airtime
  12. */
  13. class CcSubjs extends BaseCcSubjs {
  14. public function isAdminOrPM()
  15. {
  16. return $this->type === UTYPE_ADMIN || $this->type === UTYPE_PROGRAM_MANAGER;
  17. }
  18. public function isHostOfShow($showId)
  19. {
  20. return CcShowHostsQuery::create()
  21. ->filterByDbShow($showId)
  22. ->filterByDbHost($this->getDbId())
  23. ->count() > 0;
  24. }
  25. public function isHostOfShowInstance($instanceId)
  26. {
  27. $showInstance = CcShowInstancesQuery::create()
  28. ->findPk($instanceId);
  29. return CcShowHostsQuery::create()
  30. ->filterByDbShow($showInstance->getDbShowId())
  31. ->filterByDbHost($this->getDbId())
  32. ->count() > 0;
  33. }
  34. } // CcSubjs