Clear all sales

@param  SaleClearStatusEvent $event
@throws \Exception
342943
public function clearStatus(/** @noinspection PhpUnusedParameterInspection */ SaleClearStatusEvent $event)
    {
        $con = Propel::getWriteConnection(SaleTableMap::DATABASE_NAME);
        $con->beginTransaction();

        try {
            // Set the active status of all Sales to false
            SaleQuery::create()
                ->filterByActive(true)
                ->update([ 'Active' => false ], $con)
            ;

            // Reset all sale status on PSE
            ProductSaleElementsQuery::create()
                ->filterByPromo(true)
                ->update([ 'Promo' => false], $con)
            ;

            $con->commit();
        } catch (PropelException $e) {
            $con->rollback();
            throw $e;
        }
    }
764869
public function clean(\Zend_EventManager_EventDescription $event)
    {      
        $params = $event->getParams();
        $mode = \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG;

        if (isset($params['mode'])) {
            $mode = $params['mode'];   
        }

        return $this->cache->clean($mode, $this->_getTags($event));
    }
1280160
protected function clearReportEvent()
    {
        $key = 'clear';
        $this->controlToken($key);

        if ($this->isQuery($key)) {
            $this->report->delete();
            $this->redirect('admin/report/events');
        }
    }
1003714
public function off($event)
   {
      list($type, $namespace) = Event::split($event);

      for ($i=count($this->eventHandlers)-1; $i>-1; $i--) {
         $h = $this->eventHandlers[$i];
         if ($type !== null && $h->getType() !== $type) {
            continue;
         }
         else if ($namespace !== null && $h->getNamespace() !== $namespace) {
            continue;
         }
         
         array_splice($this->eventHandlers, $i, 1);
      }

      return $this;
   }
595457
public static function clear( $event, $what = null ) {
		if ( is_null( $what ) ) {
			unset( static::$events[$event] ); return;
		}
		
		if ( array_key_exists( $what, static::$events[$event][$what] ) ) {
			unset( static::$events[$event][$what] );
		}
	}
1102544
public function clear()
    {
        if (null !== $this->aSport) {
            $this->aSport->removeGroup($this);
        }
        $this->id = null;
        $this->title = null;
        $this->description = null;
        $this->slug = null;
        $this->sport_id = null;
        $this->skill_count = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
603227
public function onPostDelete(OrderEvent $event)
    {
        $order = $event->getOrder();
        if ($order->getType() === OrderTypes::TYPE_CART) {
            $this->provider->clearCart();
        }
    }
197873
function clear_all( $store = true, $exceptions = array() ) {
			$new_data = array();
			foreach ( $exceptions as $key ) {
				if ( isset( $this->_data[ $key ] ) ) {
					$new_data[ $key ] = $this->_data[ $key ];
				}
			}

			$this->_data = $new_data;

			if ( $store ) {
				$all_data                 = $this->get_all_data();
				$all_data[ $this->_secondary_id ] = $this->_data;
				$options_manager          = $this->get_option_manager();
				$options_manager->set_option( $this->_id, $all_data, true );
			}
		}
1349752
public function deleteFeatureProductValue(FeatureProductDeleteEvent $event)
    {
        FeatureProductQuery::create()
            ->filterByProductId($event->getProductId())
            ->filterByFeatureId($event->getFeatureId())
            ->delete()
        ;
    }
772312
public function onDelete(GenericDataEvent $event)
    {
        /** @var UserEntity[] $users */
        $users = $event->getData();

        $ids = [];
        foreach ($users as $user) {
            $ids[] = $user->getId();
        }

        $this->manager->removeTaggedObjectsByClassAndIds(UserEntity::class, $ids);
    }
1040044
protected function propagateCollectionChangedEvent(CollectionChangedEvent $event)
    {
        if ($event->getType() === CollectionChangedEvent::ITEM_REMOVED) {
            $event->getItem()->removeEntityChangedListener($this);
        } else {
            $event->getItem()->addEntityChangedListener($this);
        }

        parent::propagateCollectionChangedEvent($event);
    }
50996
public function onDelete(DeleteResourceEvent $event)
    {
        $this->om->remove($event->getResource());
        $event->stopPropagation();
    }
1200182
public function create(SaleCreateEvent $event)
    {
        $sale = new SaleModel();

        $sale
            ->setLocale($event->getLocale())
            ->setTitle($event->getTitle())
            ->setSaleLabel($event->getSaleLabel())
            ->save()
        ;

        $event->setSale($sale);
    }
586343
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof ArticleDocument) {
            return;
        }

        $this->indexer->remove($document);
        $this->indexer->flush();
    }
108121
private function clearEmptyArrayInEvent(array $event) {
        $repackEvent = [];
        foreach ($event as $key => $value) {
            if(is_array($value) && count($value) > 0) {
                $repackEvent[$key] = $this->clearEmptyArrayInEvent($value);
            }else if(!is_array($value)) {
                $repackEvent[$key] = $value;
            }
        }
        return $repackEvent;
    }
701943
public function onWorkspacesDelete(GenericDatasEvent $event)
    {
        $workspaces = $event->getDatas();
        $ids = array();

        foreach ($workspaces as $workspace) {
            $ids[] = $workspace->getId();
        }
        $this->tagManager->removeTaggedObjectsByClassAndIds(
            'Claroline\CoreBundle\Entity\Workspace\Workspace',
            $ids
        );
    }
622693
public function onClean(SubscriberEvent $event)
    {
        $this->listRepository->clean(
            $event->getListId(),
            $event->getSubscriber()
        );
    }