CcFiles.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Skeleton subclass for representing a row from the 'cc_files' 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.campcaster
  12. */
  13. class CcFiles extends BaseCcFiles {
  14. public function getCueLength()
  15. {
  16. $cuein = $this->getDbCuein();
  17. $cueout = $this->getDbCueout();
  18. $cueinSec = Application_Common_DateHelper::calculateLengthInSeconds($cuein);
  19. $cueoutSec = Application_Common_DateHelper::calculateLengthInSeconds($cueout);
  20. $lengthSec = bcsub($cueoutSec, $cueinSec, 6);
  21. $length = Application_Common_DateHelper::secondsToPlaylistTime($lengthSec);
  22. return $length;
  23. }
  24. public function setDbTrackNumber($v)
  25. {
  26. $max = pow(2, 31)-1;
  27. $v = ($v > $max) ? $max : $v;
  28. return parent::setDbTrackNumber($v);
  29. }
  30. // returns true if the file exists and is not hidden
  31. public function visible() {
  32. return $this->getDbFileExists() && !$this->getDbHidden();
  33. }
  34. public function reassignTo($user)
  35. {
  36. $this->setDbOwnerId( $user->getDbId() );
  37. $this->save();
  38. }
  39. } // CcFiles