/**
  * @param PDO $dbConn
  *
  * @param Segment $segmentObject
  *
  */
 public static function editExistingSegmentDuration($dbConn, $segmentObject)
 {
     $columnNames = array(self::DURATION_COLUMN_NAME);
     $values = array($segmentObject->getDuration());
     error_log("segment duration: " . $segmentObject->getDuration());
     writeToDatabase::editDatabaseEntry($dbConn, $segmentObject->getId(), self::TABLE_NAME, $columnNames, $values);
 }
Ejemplo n.º 2
0
 /**
  * @param Segment $segment
  *
  * @return void
  */
 public function add($segment)
 {
     if (!$this->exists(function ($key, Segment $element) use($segment) {
         return $segment->getId() == $element->getId();
     })) {
         parent::add($segment);
     }
 }