aboutsummaryrefslogtreecommitdiff
path: root/vendor/studip_ws/method.php
blob: 3861764eaed534d6ce8c09b4f3d716e24047b774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php

/*
 * method.php - ADT for methods of services.
 *
 * Copyright (C) 2006 - Marcus Lunzenauer <mlunzena@uos.de>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 */


/**
 * <ClassDescription>
 *
 * @package   <package>
 * @package   <package>
 *
 * @author    mlunzena
 * @copyright (c) Authors
 * @version   $Id: method.php 3888 2006-09-06 13:27:19Z mlunzena $
 */

class Studip_Ws_Method {

  
  /**
   * <FieldDescription>
   *
   * @access private
   * @var <type>
   */
  var $service;

  
  /**
   * <FieldDescription>
   *
   * @access private
   * @var <type>
   */
  var $name;

  
  /**
   * <FieldDescription>
   *
   * @access private
   * @var <type>
   */
  var $expects;

  
  /**
   * <FieldDescription>
   *
   * @access private
   * @var <type>
   */
  var $returns;

  
  /**
   * <FieldDescription>
   *
   * @access private
   * @var <type>
   */
  var $description;

  
  /**
   * <MethodDescription>
   *
   * @param type <description>
   *
   * @return type <description>
   */
	function __construct(&$service, $name,
	                          $expects = NULL,
	                          $returns = NULL,
	                          $description = '') {

    # check $expects
    if (is_null($expects))
      $expects = array();
    else if (!is_array($expects)) {
      trigger_error('Third argument is expected to be an array.',
                    E_USER_ERROR);
      return;
    }

	  $this->service     =& $service;
	  $this->name        = $name;
	  $this->description = (string) $description;
	  $this->expects     = $expects;
	  $this->returns     = $returns;

    foreach ($this->expects as $key => $entry)
      $this->expects[$key] = Studip_Ws_Type::translate($entry);
    
    $this->returns = Studip_Ws_Type::translate($this->returns);
	}
}