original_string: public function setPrimary($role)
      {
          if (!$this->handlePrimary($role)) {
              return false;
          }
          $primaryField = $this->getPrimaryField($role);
          $primarySiblings = $this->getSiblings($role, true);
          foreach ($primarySiblings as $sibling) {
              $sibling->{$primaryField} = 0;
              if (!$sibling->save()) {
                  return false;
              }
          }
          $this->owner->{$primaryField} = 1;
  
          return $this->owner->save();
      }
code: public function setPrimary($role)
      {
          if (!$this->handlePrimary($role)) {
              return false;
          }
          $primaryField = $this->getPrimaryField($role);
          $primarySiblings = $this->getSiblings($role, true);
          foreach ($primarySiblings as $sibling) {
              $sibling->{$primaryField} = 0;
              if (!$sibling->save()) {
                  return false;
              }
          }
          $this->owner->{$primaryField} = 1;
  
          return $this->owner->save();
      }
code_tokens: public function setPrimary ( $ role ) { if ( ! $ this -> handlePrimary ( $ role ) ) { return false ; } $ primaryField = $ this -> getPrimaryField ( $ role ) ; $ primarySiblings = $ this -> getSiblings ( $ role , true ) ; foreach ( $ primarySiblings as $ sibling ) { $ sibling -> { $ primaryField } = 0 ; if ( ! $ sibling -> save ( ) ) { return false ; } } $ this -> owner -> { $ primaryField } = 1 ; return $ this -> owner -> save ( ) ; }
docstring: Set primary.
  
  @param [[@doctodo param_type:role]] $role [[@doctodo param_description:role]]
  
  @return [[@doctodo return_type:setPrimary]] [[@doctodo return_description:setPrimary]]
docstring_tokens: Set primary .