original_string: public function update($idSegment, $name, $definition, $idSite = false, $autoArchive = false, $enabledAllUsers = false)
      {
          $segment = $this->getSegmentOrFail($idSegment);
          $this->checkUserCanEditOrDeleteSegment($segment);
  
          $idSite = $this->checkIdSite($idSite);
          $this->checkSegmentName($name);
          $definition      = $this->checkSegmentValue($definition, $idSite);
          $enabledAllUsers = $this->checkEnabledAllUsers($enabledAllUsers);
          $autoArchive     = $this->checkAutoArchive($autoArchive, $idSite);
  
          $bind = array(
              'name'               => $name,
              'definition'         => $definition,
              'enable_all_users'   => $enabledAllUsers,
              'enable_only_idsite' => $idSite,
              'auto_archive'       => $autoArchive,
              'ts_last_edit'       => Date::now()->getDatetime(),
          );
  
          /**
           * Triggered before a segment is modified.
           *
           * This event can be used by plugins to throw an exception
           * or do something else.
           *
           * @param int $idSegment The ID of the segment which visibility is reduced.
           */
          Piwik::postEvent('SegmentEditor.update', array($idSegment, $bind));
  
          $this->getModel()->updateSegment($idSegment, $bind);
  
          return true;
      }
code: public function update($idSegment, $name, $definition, $idSite = false, $autoArchive = false, $enabledAllUsers = false)
      {
          $segment = $this->getSegmentOrFail($idSegment);
          $this->checkUserCanEditOrDeleteSegment($segment);
  
          $idSite = $this->checkIdSite($idSite);
          $this->checkSegmentName($name);
          $definition      = $this->checkSegmentValue($definition, $idSite);
          $enabledAllUsers = $this->checkEnabledAllUsers($enabledAllUsers);
          $autoArchive     = $this->checkAutoArchive($autoArchive, $idSite);
  
          $bind = array(
              'name'               => $name,
              'definition'         => $definition,
              'enable_all_users'   => $enabledAllUsers,
              'enable_only_idsite' => $idSite,
              'auto_archive'       => $autoArchive,
              'ts_last_edit'       => Date::now()->getDatetime(),
          );
  
          /**
           * Triggered before a segment is modified.
           *
           * This event can be used by plugins to throw an exception
           * or do something else.
           *
           * @param int $idSegment The ID of the segment which visibility is reduced.
           */
          Piwik::postEvent('SegmentEditor.update', array($idSegment, $bind));
  
          $this->getModel()->updateSegment($idSegment, $bind);
  
          return true;
      }
code_tokens: public function update ( $ idSegment , $ name , $ definition , $ idSite = false , $ autoArchive = false , $ enabledAllUsers = false ) { $ segment = $ this -> getSegmentOrFail ( $ idSegment ) ; $ this -> checkUserCanEditOrDeleteSegment ( $ segment ) ; $ idSite = $ this -> checkIdSite ( $ idSite ) ; $ this -> checkSegmentName ( $ name ) ; $ definition = $ this -> checkSegmentValue ( $ definition , $ idSite ) ; $ enabledAllUsers = $ this -> checkEnabledAllUsers ( $ enabledAllUsers ) ; $ autoArchive = $ this -> checkAutoArchive ( $ autoArchive , $ idSite ) ; $ bind = array ( 'name' => $ name , 'definition' => $ definition , 'enable_all_users' => $ enabledAllUsers , 'enable_only_idsite' => $ idSite , 'auto_archive' => $ autoArchive , 'ts_last_edit' => Date :: now ( ) -> getDatetime ( ) , ) ; /**
           * Triggered before a segment is modified.
           *
           * This event can be used by plugins to throw an exception
           * or do something else.
           *
           * @param int $idSegment The ID of the segment which visibility is reduced.
           */ Piwik :: postEvent ( 'SegmentEditor.update' , array ( $ idSegment , $ bind ) ) ; $ this -> getModel ( ) -> updateSegment ( $ idSegment , $ bind ) ; return true ; }
docstring: Modifies an existing stored segment.
  
  @param int $idSegment The ID of the stored segment to modify.
  @param string $name The new name of the segment.
  @param string $definition The new definition of the segment.
  @param bool $idSite If supplied, associates the stored segment with as single site.
  @param bool $autoArchive Whether to automatically archive data with the segment or not.
  @param bool $enabledAllUsers Whether the stored segment is viewable by all users or just the one that created it.
  
  @return bool
docstring_tokens: Modifies an existing stored segment .