private function insertPlaylistElement($info) { $row = new CcPlaylistcontents(); $row->setDbPlaylistId($this->id); $row->setDbPosition($info["pos"]); $row->setDbCliplength($info["cliplength"]); $row->setDbCuein($info["cuein"]); $row->setDbCueout($info["cueout"]); $row->setDbFadein(Application_Common_DateHelper::secondsToPlaylistTime($info["fadein"])); $row->setDbFadeout(Application_Common_DateHelper::secondsToPlaylistTime($info["fadeout"])); if ($info["ftype"] == "audioclip") { $row->setDbFileId($info["id"]); $row->setDbTrackOffset($info["crossfadeDuration"]); $type = 0; } elseif ($info["ftype"] == "stream") { $row->setDbStreamId($info["id"]); $type = 1; } elseif ($info["ftype"] == "block") { $row->setDbBlockId($info["id"]); $type = 2; } $row->setDbType($type); $row->save($this->con); // above save result update on cc_playlist table on length column. // but $this->pl doesn't get updated automatically // so we need to manually grab it again from DB so it has updated values // It is something to do FORMAT_ON_DEMAND( Lazy Loading ) $this->pl = CcPlaylistQuery::create()->findPK($this->id); }