<commit_before><?php

class CM_Model_StreamChannel_Video extends CM_Model_StreamChannel_Abstract {

	const TYPE = 19;

	public function onPublish(CM_Model_Stream_Publish $streamPublish) {
	}

	public function onSubscribe(CM_Model_Stream_Subscribe $streamSubscribe) {
	}

	public function onUnpublish(CM_Model_Stream_Publish $streamPublish) {
	}

	public function onUnsubscribe(CM_Model_Stream_Subscribe $streamSubscribe) {
	}

	/**
	 * @return int
	 */
	public function getWidth() {
		return (int) $this->_get('width');
	}

	/**
	 * @return int
	 */
	public function getHeight() {
		return (int) $this->_get('height');
	}

	/**
	 * @return string
	 */
	public function getWowzaIp() {
		return (string) $this->_get('wowzaIp');
	}

	protected function _loadData() {
		return CM_Mysql::exec("SELECT * FROM TBL_CM_STREAMCHANNEL JOIN TBL_CM_STREAMCHANNEL_VIDEO USING (`id`) WHERE `id` = ?", $this->getId())->fetchAssoc();
	}

	protected static function _create(array $data) {
		$key = (string) $data['key'];
		$width = (int) $data['width'];
		$height = (int) $data['height'];
		$wowzaIp = $data['wowzaIp'];
		$id = CM_Mysql::insert(TBL_CM_STREAMCHANNEL, array('key' => $key, 'type' => static::TYPE));
		try {
			CM_Mysql::insert(TBL_CM_STREAMCHANNEL_VIDEO, array('id' => $id, 'width' => $width, 'height' => $height, 'wowzaIp' => $wowzaIp));
		} catch (CM_Exception $ex) {
			CM_Mysql::delete(TBL_CM_STREAMCHANNEL, array('id' => $id));<commit_msg>t328: Video streamchannel gets deleted if stream channel gets deleted<commit_after><?php

class CM_Model_StreamChannel_Video extends CM_Model_StreamChannel_Abstract {

	const TYPE = 19;

	public function onPublish(CM_Model_Stream_Publish $streamPublish) {
	}

	public function onSubscribe(CM_Model_Stream_Subscribe $streamSubscribe) {
	}

	public function onUnpublish(CM_Model_Stream_Publish $streamPublish) {
	}

	public function onUnsubscribe(CM_Model_Stream_Subscribe $streamSubscribe) {
	}

	/**
	 * @return int
	 */
	public function getWidth() {
		return (int) $this->_get('width');
	}

	/**
	 * @return int
	 */
	public function getHeight() {
		return (int) $this->_get('height');
	}

	/**
	 * @return string
	 */
	public function getWowzaIp() {
		return (string) $this->_get('wowzaIp');
	}

	protected function _onDelete() {
		CM_Mysql::delete(TBL_CM_STREAMCHANNEL_VIDEO, array('id' => $this->getId()));
		parent::_onDelete();
	}

	protected function _loadData() {
		return CM_Mysql::exec("SELECT * FROM TBL_CM_STREAMCHANNEL JOIN TBL_CM_STREAMCHANNEL_VIDEO USING (`id`) WHERE `id` = ?", $this->getId())->fetchAssoc();
	}

	protected static function _create(array $data) {
		$key = (string) $data['key'];
		$width = (int) $data['width'];
		$height = (int) $data['height'];
		$wowzaIp = $data['wowzaIp'];
		$id = CM_Mysql::insert(TBL_CM_STREAMCHANNEL, array('key' => $key, 'type' => static::TYPE));
		try {
			CM_Mysql::insert(TBL_CM_STREAMCHANNEL_VIDEO, array('id' => $id, 'width' => $width, 'height' => $height, 'wowzaIp' => $wowzaIp));
		} catch (CM_Exception $ex) {
			CM_Mysql::delete(TBL_CM_STREAMCHANNEL, array('id' => $id));
{'fraction_non_alphanumeric': 0.16146848602988953, 'fraction_numerical': 0.0022742040285899934, 'mean_word_length': 5.3615702479338845, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3219046', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1086, 'n_words': 215}