Class: dataDate

Attributes:
Inherits:
Implements:

Contents:

Introduction

Attention
Attention: No description has been provided for this class.

Meta Data

Attention
Attention: There is no meta data for this class.

Constants

Constant Name Constant Value
FORMAT_SHORT j M Y
FORMAT_MEDIUM D, j F, Y
FORMAT_LONG l F jS, Y

Properties

Methods

Also See

Attention
Attention: There are no additional references for this class.

Class Syntax

In file D:\oblib-core\php\oblib\dataType\dataEra.datatype.php between lines 155 and 208.

<?php
 
    
class dataDate extends dataEra
    
{
        
        const 
FORMAT_SHORT    'j M Y';
        const 
FORMAT_MEDIUM    'D, j F, Y';
        const 
FORMAT_LONG    'l F jS, Y';
        
        public function 
___setValue ($mixNodeValue)
        {
            if (
is_array ($mixNodeValue))
            {
                
$mixNodeValue mktime (
                    
000,
                    (isset (
$mixNodeValue ['Month'])    ? $mixNodeValue ['Month']    : 0),
                    (isset (
$mixNodeValue ['Day'])        ? $mixNodeValue ['Day']        : 0),
                    (isset (
$mixNodeValue ['Year'])        ? $mixNodeValue ['Year']    : 0)
                );
            }
            
            
$this->_intTimestamp $mixNodeValue;
        }
        
        public function 
___getSql ()
        {
            if (!
$this->_intTimestamp)
            {
                return 
NULL;
            }
            
            return 
date ('Y-m-d'$this->_intTimestamp);
        }
        
        public function &
___Render (DOMNode $domBase=NULL)
        {
            if (
$this->Year)            $this->___Pop ($this->___Pull ('Year'));
            if (
$this->Month)            $this->___Pop ($this->___Pull ('Month'));
            if (
$this->Day)                $this->___Pop ($this->___Pull ('Day'));
            if (
$this->FormatShort)        $this->___Pop ($this->___Pull ('FormatShort'));
            if (
$this->FormatMedium)    $this->___Pop ($this->___Pull ('FormatMedium'));
            if (
$this->FormatLong)        $this->___Pop ($this->___Pull ('FormatLong'));
            
            if (
$this->_intTimestamp)
            {
                
$this->___Push (new dataNumber ('Year'            date ('Y'$this->_intTimestamp)));
                
$this->___Push (new dataNumber ('Month'            date ('m'$this->_intTimestamp)));
                
$this->___Push (new dataNumber ('Day'            date ('d'$this->_intTimestamp)));
                
$this->___Push (new dataString ('FormatShort'    date (self::FORMAT_SHORT        $this->_intTimestamp)));
                
$this->___Push (new dataString ('FormatMedium'    date (self::FORMAT_MEDIUM        $this->_intTimestamp)));
                
$this->___Push (new dataString ('FormatLong'    date (self::FORMAT_LONG        $this->_intTimestamp)));
            }
            
            return 
parent::___Render ($domBase);
        }
    }

?>