original_string: protected function convertPropertiesToQueryArray(PropertiesInterface $properties)
      {
          $propertiesArray = [];
  
          $propertyCounter = 0;
          $propertiesArray[Constants::CONTROL_PROP_ID] = [];
          $propertiesArray[Constants::CONTROL_PROP_VALUE] = [];
          foreach ($properties->getProperties() as $property) {
              $propertiesArray[Constants::CONTROL_PROP_ID][$propertyCounter] = $property->getId();
  
              $propertyValues = $property->getValues();
  
              if (count($propertyValues) === 1) {
                  $propertiesArray[Constants::CONTROL_PROP_VALUE][$propertyCounter] =
                      $this->convertPropertyValueToSimpleType(
                          $property->getFirstValue()
                      );
              } elseif (count($propertyValues) > 1) {
                  $propertyValueCounter = 0;
                  $propertiesArray[Constants::CONTROL_PROP_VALUE][$propertyCounter] = [];
                  foreach ($propertyValues as $propertyValue) {
                      $propertiesArray[Constants::CONTROL_PROP_VALUE][$propertyCounter][$propertyValueCounter] =
                          $this->convertPropertyValueToSimpleType(
                              $propertyValue
                          );
                      $propertyValueCounter ++;
                  }
              }
  
              $propertyCounter ++;
          }
  
          return $propertiesArray;
      }
code: protected function convertPropertiesToQueryArray(PropertiesInterface $properties)
      {
          $propertiesArray = [];
  
          $propertyCounter = 0;
          $propertiesArray[Constants::CONTROL_PROP_ID] = [];
          $propertiesArray[Constants::CONTROL_PROP_VALUE] = [];
          foreach ($properties->getProperties() as $property) {
              $propertiesArray[Constants::CONTROL_PROP_ID][$propertyCounter] = $property->getId();
  
              $propertyValues = $property->getValues();
  
              if (count($propertyValues) === 1) {
                  $propertiesArray[Constants::CONTROL_PROP_VALUE][$propertyCounter] =
                      $this->convertPropertyValueToSimpleType(
                          $property->getFirstValue()
                      );
              } elseif (count($propertyValues) > 1) {
                  $propertyValueCounter = 0;
                  $propertiesArray[Constants::CONTROL_PROP_VALUE][$propertyCounter] = [];
                  foreach ($propertyValues as $propertyValue) {
                      $propertiesArray[Constants::CONTROL_PROP_VALUE][$propertyCounter][$propertyValueCounter] =
                          $this->convertPropertyValueToSimpleType(
                              $propertyValue
                          );
                      $propertyValueCounter ++;
                  }
              }
  
              $propertyCounter ++;
          }
  
          return $propertiesArray;
      }
code_tokens: protected function convertPropertiesToQueryArray ( PropertiesInterface $ properties ) { $ propertiesArray = [ ] ; $ propertyCounter = 0 ; $ propertiesArray [ Constants :: CONTROL_PROP_ID ] = [ ] ; $ propertiesArray [ Constants :: CONTROL_PROP_VALUE ] = [ ] ; foreach ( $ properties -> getProperties ( ) as $ property ) { $ propertiesArray [ Constants :: CONTROL_PROP_ID ] [ $ propertyCounter ] = $ property -> getId ( ) ; $ propertyValues = $ property -> getValues ( ) ; if ( count ( $ propertyValues ) === 1 ) { $ propertiesArray [ Constants :: CONTROL_PROP_VALUE ] [ $ propertyCounter ] = $ this -> convertPropertyValueToSimpleType ( $ property -> getFirstValue ( ) ) ; } elseif ( count ( $ propertyValues ) > 1 ) { $ propertyValueCounter = 0 ; $ propertiesArray [ Constants :: CONTROL_PROP_VALUE ] [ $ propertyCounter ] = [ ] ; foreach ( $ propertyValues as $ propertyValue ) { $ propertiesArray [ Constants :: CONTROL_PROP_VALUE ] [ $ propertyCounter ] [ $ propertyValueCounter ] = $ this -> convertPropertyValueToSimpleType ( $ propertyValue ) ; $ propertyValueCounter ++ ; } } $ propertyCounter ++ ; } return $ propertiesArray ; }
docstring: Converts a Properties list into an array that can be used for the CMIS request.
  
  @param PropertiesInterface $properties
  @return array Example <code>
  array('propertyId' => array(0 => 'myId'), 'propertyValue' => array(0 => 'valueOfMyId'))
  </code>
docstring_tokens: Converts a Properties list into an array that can be used for the CMIS request .