You are here

class WebformObjectHelper in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformObjectHelper.php \Drupal\webform\Utility\WebformObjectHelper

Provides helper to operate on objects.

Hierarchy

Expanded class hierarchy of WebformObjectHelper

2 files declare their use of WebformObjectHelper
WebformCliService.php in src/Commands/WebformCliService.php
WebformObjectHelperTest.php in tests/src/Unit/Utility/WebformObjectHelperTest.php

File

src/Utility/WebformObjectHelper.php, line 8

Namespace

Drupal\webform\Utility
View source
class WebformObjectHelper {

  /**
   * Sort object by properties.
   *
   * @param object $object
   *   An object.
   *
   * @return object
   *   Object sorted by properties.
   */
  public static function sortByProperty($object) {
    $array = (array) $object;
    ksort($array);
    return (object) $array;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WebformObjectHelper::sortByProperty public static function Sort object by properties.