/** * Returns class instance * * @return VWVC_BOL_ClipDao */ public static function getInstance() { if (null === self::$classInstance) { self::$classInstance = new self(); } return self::$classInstance; }
/** public function addCodeParam( $code, $name = 'wmode', $value = 'transparent' ) { $repl = $code; if ( preg_match("/<object/i", $code) ) { $searchPattern = '<param'; $pos = stripos($code, $searchPattern); if ( $pos ) { $addParam = '<param name="' . $name . '" value="' . $value . '"></param><param'; $repl = substr_replace($code, $addParam, $pos, strlen($searchPattern)); } } if ( preg_match("/<embed/i", isset($repl) ? $repl : $code) ) { $repl = preg_replace("/<embed/i", '<embed ' . $name . '="' . $value . '"', isset($repl) ? $repl : $code); } return $repl; } */ public function updateUserClipsPrivacy($userId, $privacy) { if (!$userId || !mb_strlen($privacy)) { return false; } $clips = $this->clipDao->findByUserId($userId); if (!$clips) { return true; } $this->clipDao->updatePrivacyByUserId($userId, $privacy); $event = new OW_Event('base.update_entity_items_status', array('entityType' => 'vwvc_comments', 'entityIds' => $clips, 'status' => $privacy == 'everybody')); OW::getEventManager()->trigger($event); return true; }