original_string: public function addObjectAtPosition($value, $intPosition)
      {
          $arrTempCollection = array();
          $intCount = 0;
  
          if ($intPosition >= $this->count()) {
              // *** Position is greater than the collection count. Just add at the end.
              $this->addObject($value);
          } else {
              foreach ($this->collection as $varObject) {
                  if ($intCount == $intPosition) {
                      // *** Insert the new object.
                      array_push($arrTempCollection, $value);
                  }
  
                  // *** Insert the existing object.
                  array_push($arrTempCollection, $varObject);
                  $intCount ++;
              }
  
              // *** Replace the collection.
              $this->collection = $arrTempCollection;
          }
      }
code: public function addObjectAtPosition($value, $intPosition)
      {
          $arrTempCollection = array();
          $intCount = 0;
  
          if ($intPosition >= $this->count()) {
              // *** Position is greater than the collection count. Just add at the end.
              $this->addObject($value);
          } else {
              foreach ($this->collection as $varObject) {
                  if ($intCount == $intPosition) {
                      // *** Insert the new object.
                      array_push($arrTempCollection, $value);
                  }
  
                  // *** Insert the existing object.
                  array_push($arrTempCollection, $varObject);
                  $intCount ++;
              }
  
              // *** Replace the collection.
              $this->collection = $arrTempCollection;
          }
      }
code_tokens: public function addObjectAtPosition ( $ value , $ intPosition ) { $ arrTempCollection = array ( ) ; $ intCount = 0 ; if ( $ intPosition >= $ this -> count ( ) ) { // *** Position is greater than the collection count. Just add at the end. $ this -> addObject ( $ value ) ; } else { foreach ( $ this -> collection as $ varObject ) { if ( $ intCount == $ intPosition ) { // *** Insert the new object. array_push ( $ arrTempCollection , $ value ) ; } // *** Insert the existing object. array_push ( $ arrTempCollection , $ varObject ) ; $ intCount ++ ; } // *** Replace the collection. $ this -> collection = $ arrTempCollection ; } }
docstring: Add object to the collection at a specified position
  
  @param object $value The object
  @param integer $intPosition The position the object should be placed at.
docstring_tokens: Add object to the collection at a specified position