You are here

WebformObjectHelper.php in Webform 8.5

Same filename and directory in other branches
  1. 6.x src/Utility/WebformObjectHelper.php

File

src/Utility/WebformObjectHelper.php
View source
<?php

namespace Drupal\webform\Utility;


/**
 * Provides helper to operate on objects.
 */
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;
  }

}

Classes

Namesort descending Description
WebformObjectHelper Provides helper to operate on objects.