44
55use DateTimeZone ;
66use Webforge \Common \Util AS Code ;
7+ use Webforge \Common \Exception ;
8+ use InvalidArgumentException ;
79
810class DateTime extends \DateTime {
911
@@ -24,7 +26,7 @@ class DateTime extends \DateTime {
2426
2527 public function __construct ($ time = NULL , DateTimeZone $ object = NULL ) {
2628 if (isset ($ object )) {
27- throw new \ Psc \ Exception ('Timezone im Constructor setzen geht nicht in PHP 5.3 ' );
29+ throw new Exception ('Timezone im Constructor setzen geht nicht in PHP 5.3 ' );
2830 }
2931
3032 if ($ time instanceof \DateTime) {
@@ -56,7 +58,7 @@ public function __construct($time = NULL, DateTimeZone $object = NULL) {
5658 }
5759
5860 /**
59- * @return PscDateTime
61+ * @return DateTime
6062 */
6163 public static function factory ($ time = NULL , DateTimeZone $ object = NULL ) {
6264 return new DateTime ($ time , $ object );
@@ -155,7 +157,7 @@ public static function parse($format, $time, DateTimeZone $timezone = NULL) {
155157 * Wollen wir den Montag des Sonntages liegt das Datum in der Vergangenheit
156158 *
157159 * ist heute also Sonntag der 20.3.2011 und der Parameter ist MON gibt Funktion Montag den 14.03.2011 zurück (gleiche Uhrzeit wie jetzt)
158- * @return PscDateTime
160+ * @return DateTime
159161 */
160162 public function getWeekday ($ day ) {
161163
@@ -243,15 +245,6 @@ public function getWalkableFields() {
243245 );
244246 }
245247
246-
247- public function getWalkableType ($ field ) {
248- if ($ field === 'date ' ) {
249- return \Psc \Data \Type \Type::create ('Integer ' );
250- } elseif ($ field === 'timezone ' ) {
251- return \Psc \Data \Type \Type::create ('String ' );
252- }
253- }
254-
255248 public function export () {
256249 return (object ) array (
257250 'date ' =>$ this ->format ('U ' ),
@@ -268,7 +261,7 @@ public static function import(\stdClass $o) {
268261 * @param int $year unbedingt ein int
269262 */
270263 public function setYear ($ year ) {
271- if (!is_int ($ year )) throw new \ InvalidArgumentException ('Parameter 1 muss ein Integer sein ' );
264+ if (!is_int ($ year )) throw new InvalidArgumentException ('Parameter 1 muss ein Integer sein ' );
272265 $ this ->setDate ($ year , $ this ->getMonth (), $ this ->getDay ()); // das ist die PHP Funktion
273266 return $ this ;
274267 }
0 commit comments