-
Notifications
You must be signed in to change notification settings - Fork 0
/
Object.php
executable file
·77 lines (70 loc) · 1.22 KB
/
Object.php
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
<?php
/**
* Sabel Object
*
* @abstract
* @category Core
* @package org.sabel.core
* @author Mori Reo <mori.reo@sabel.jp>
* @author Ebine Yutaka <ebine.yutaka@sabel.jp>
* @copyright 2004-2008 Mori Reo <mori.reo@sabel.jp>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/
abstract class Sabel_Object
{
/**
* @param string $name
*
* @return boolean
*/
public final function hasMethod($name)
{
return method_exists($this, $name);
}
/**
* @return string
*/
public function getName()
{
return get_class($this);
}
/**
* @return string
*/
public function __toString()
{
return $this->hashCode();
}
/**
* @param object $object
*
* @return boolean
*/
public function equals($object)
{
return ($this == $object);
}
/**
* @return string
*/
public function hashCode()
{
return sha1(serialize($this));
}
/**
* @return Sabel_Reflection_Class
*/
public function getReflection()
{
return new Sabel_Reflection_Class($this);
}
/**
* an alias for __toString()
*
* @return string
*/
public final function toString()
{
return $this->__toString();
}
}