예제 #1
0
 public function testCopyPrivatePropertyFromSubClassObject()
 {
     $obj1 = new SubClass();
     $obj1->setPrivateProperty('Modified private property value of BaseClass');
     $obj2 = new BaseClass();
     $obj2->copyPrivateProperty($obj1);
     $this->assertEquals('Modified private property value of BaseClass', $obj2->getPrivateProperty());
     $obj3 = new SubClass();
     $obj3->copyPrivateProperty($obj1);
     $this->assertEquals('Modified private property value of BaseClass', $obj3->getPrivateProperty());
 }
예제 #2
0
	public function
	save() {
		if (!$this->id) {
			return $this->create();
		}
		return parent::save();
	}
예제 #3
0
파일: Weapon.php 프로젝트: Naddiseo/WW2Game
	public function
	create() {
		if (!$this->weaponCount or $this->weaponCount <= 0) {
			return 0;
		}
		return parent::create();
	}
예제 #4
0
 function loadFromDB($id)
 {
     $ret = parent::loadFromDB($id);
     global $_CONF;
     $this->invitationExpired = strtotime($this->invitationDate) < strtotime('now');
     $this->Active = $this->invitationActive && !$this->invitationExpired;
     return $ret;
 }
예제 #5
0
 public function test($tmp = null)
 {
     echo "childClass::sss";
     parent::test();
     self::called();
     echo self::CONST_VALUE;
     echo static::$sValue1;
 }
예제 #6
0
파일: Table.php 프로젝트: alsimfer/HomePage
 /**
  * 
  */
 public function __construct($id, $name, $css_class, $script)
 {
     parent::__construct();
     $this->id = $id;
     $this->name = $name;
     $this->css_class = $css_class;
     $this->script = $script;
 }
예제 #7
0
 function __construct($attributes = array(), $entities = array())
 {
     $this->entities = array();
     foreach ($entities as $entity) {
         $this->append($entity->copy());
     }
     parent::__construct($attributes);
 }
예제 #8
0
 /**
  * 
  */
 public function __construct($id, $name, $css_class, $checked = FALSE)
 {
     parent::__construct();
     $this->id = $id;
     $this->name = $name;
     $this->css_class = $css_class;
     $this->checked = $checked;
 }
예제 #9
0
 public function __construct($key, $quantity, $price)
 {
     parent::__construct();
     $this->_key = $key;
     $this->_quantity = $quantity;
     $this->_price = $price;
     $this->_features = array();
 }
예제 #10
0
파일: Page.php 프로젝트: alsimfer/HomePage
 public function __construct($page_id)
 {
     parent::__construct();
     if ($page_id != NULL) {
         $page_id = (int) $page_id;
         util_Validator::validate($page_id, 'integer');
         $this->init($page_id);
     }
 }
예제 #11
0
 public function __construct($shipment_id = 0)
 {
     parent::__construct();
     if ((int) $shipment_id > 0) {
         $shipment_id = (int) $shipment_id;
         util_Validator::validate($shipment_id, 'integer');
         $this->init($shipment_id);
     }
 }
예제 #12
0
 function __construct($attributes = array())
 {
     $defaults = array();
     $defaults['name'] = 'Writer';
     $defaults['flag'] = 64;
     $defaults['color'] = 7;
     $defaults['lineType'] = 'continuous';
     parent::__construct(array_merge($defaults, $attributes));
 }
예제 #13
0
 /**
  * Constructor
  *
  * Initialize things.
  *
  */
 function __construct()
 {
     if (null == self::$_appInstance) {
         self::$_appInstance = Slim::getInstance();
     }
     if (null == self::$_dbInstance) {
         self::$_dbInstance = PDOAdpter::getInstance();
     }
 }
예제 #14
0
 function __construct($id = false)
 {
     $this->_table = "Partners";
     $this->_idfield = "partnerID";
     $this->_LINKED = array();
     $this->_FIELDTYPES = array('partnerID' => 'hidden');
     $this->_CHECKFIELDS = array('partnerID' => 'required', 'partnerName' => 'required');
     $this->_FIELDNAMES = array('partnerID' => '#', 'partnerName' => 'Имя/название');
     return parent::__construct($id);
 }
예제 #15
0
 /**
  * 加载控制器
  */
 public static function Controller($class, $isView = false, $isMuti = false, $functionName = null)
 {
     $class = str_replace(array('.', '#'), array('\\', '.'), $class);
     if ($isView) {
         self::$isView = true;
         self::$isViewMuti = $isMuti;
     }
     BaseClass::$functionName = $functionName;
     return self::getClass("\\AppMain\\controller\\" . $class . "Controller");
 }
예제 #16
0
 function loadFromHTML($data = false)
 {
     global $_POST;
     if (isset($_POST[formSubmit])) {
         $this->tripShowAvPlaces = 0;
         $this->tripHidden = 0;
         $this->langRU = 0;
         $this->langEN = 0;
     }
     return parent::loadFromHTML($data);
 }
예제 #17
0
 /**
  * 
  */
 public function __construct($id, $name, $css_class, $selected_id = 0, $placeHolder = '')
 {
     parent::__construct();
     $this->id = $id;
     $this->name = $name;
     $this->css_class = $css_class;
     $this->placeHolder = $placeHolder;
     if ((int) $selected_id > 0) {
         $this->selected_id = $selected_id;
     }
 }
예제 #18
0
 function updateDB()
 {
     $ret = parent::updateDB();
     $this->loadLinkedFromDB();
     if (is_array($this->Tours)) {
         foreach ($this->Tours as $t) {
             $t->loadFromHTML();
             $t->updateDB();
         }
     }
     return $ret;
 }
예제 #19
0
 function __construct($attributes = array())
 {
     $defaults = array();
     $defaults['name'] = 'continuous';
     $defaults['flag'] = 64;
     $defaults['description'] = 'Solid line';
     // TODO: Implement lineType elements
     //length (49),
     //elementType Complex linetype element (74)
     // shapeNo shape numeber (75)
     $defaults['elements'] = array();
     parent::__construct(array_merge($defaults, $attributes));
 }
예제 #20
0
 function __construct()
 {
     parent::__construct();
     $path = $this->getConfig('cache_path');
     $uri = Loader::getClass('Sky.core.Router');
     $key = implode($uri->segments, '.') . implode($_GET, '.');
     if (!is_dir($path)) {
         Exceptions::showError('Server Error', 'Cache Folder Not Found at: ' . $path);
     }
     if (!is_writable($path)) {
         Exceptions::showError('Server Error', 'Unable to write Cache Folder');
     }
 }
예제 #21
0
 public function __construct($type, $name)
 {
     parent::__construct();
     $this->_name = $name;
     $this->_type = $type;
     if (!is_null(self::$_context) && self::$_context->hasParam($name)) {
         $this->_value = self::$_context->getParam($name);
     } else {
         $this->_value = null;
     }
     $this->_default_value = null;
     $this->_configuration = null;
     $this->_renderer = null;
 }
예제 #22
0
파일: Style.php 프로젝트: g105b/dxfwriter
 function __construct($attributes = array())
 {
     $defaults = array();
     $defaults['name'] = 'standard';
     $defaults['flag'] = 0;
     $defaults['height'] = 0;
     $defaults['widthFactor'] = 40;
     $defaults['obliqueAngle'] = 50;
     $defaults['mirror'] = 0;
     $defaults['lastHeight'] = 1;
     $defaults['font'] = 'arial.ttf';
     $defaults['bigFont'] = '';
     parent::__construct(array_merge($defaults, $attributes));
 }
예제 #23
0
 public function moreTesting()
 {
     echo "ChildClass::moreTesting() called\n";
     parent::moreTesting();
     // parent关键字可以访问父类被重写的成员
     // step 3 self关键字可以访问该类自身的其他成员
     self::called();
     // step 4 self关键字可以访问该类定义的常量
     echo "CONST_VALUE: " . self::CONST_VALUE . "\n";
     // 常量不能被赋值修改
     // self::CONST_VALUE = 11;
     // step 5 static关键字可以访问静态成员,当调用静态属性时记得加$符号
     echo "sValue: " . static::$sValue . "\n";
 }
 public function __construct()
 {
     parent::__construct();
     $this->EE =& get_instance();
     $this->EE->load->library('google_maps');
     $this->EE->load->model('data_import_model');
     $this->EE->load->driver('Channel_data');
     if ($memory = config_item('gmap_import_memory')) {
         ini_set('memory_limit', $memory);
     }
     if ($upload_max_filesize = config_item('gmap_import_max_file_size')) {
         ini_set('upload_max_filesize', $upload_max_filesize);
         ini_set('post_max_size', $upload_max_filesize);
     }
 }
예제 #25
0
 public function __construct($contact_id = 0, $customer_id = 0)
 {
     parent::__construct();
     if ((int) $contact_id > 0) {
         $contact_id = (int) $contact_id;
         util_Validator::validate($contact_id, 'integer');
         $this->init($contact_id, 0);
     } else {
         if ((int) $customer_id > 0) {
             $customer_id = (int) $customer_id;
             util_Validator::validate($customer_id, 'integer');
             $this->init(0, $customer_id);
         }
     }
 }
예제 #26
0
 public function __construct($id, $title = '')
 {
     parent::__construct();
     if (strlen($title) > 0) {
         $this->title = $title;
     }
     //	    $this->messages['danger'] = 'DANGER';
     $this->page_id = $id;
     $this->headerHTML = $this->generateHeaderHTML();
     $this->navbarHTML = $this->generateNavBarHTML();
     $this->messagesHTML = $this->generateMessagesHTML();
     $this->scriptHTML = $this->generateScriptHTML();
     $this->footerHTML = $this->generateFooterHTML();
     // Put all parts together.
     $this->pageHTML = $this->generatePageHTML();
 }
예제 #27
0
 function __construct($attributes = array())
 {
     $defaults = array();
     $defaults['name'] = 'standard';
     $defaults['flag'] = 0;
     $defaults['width'] = 1;
     $defaults['height'] = 1;
     $defaults['center'] = array(0.5, 0.5);
     $defaults['direction'] = array(0, 0, 1);
     $defaults['target'] = array(0, 0, 0);
     $defaults['lens'] = 50;
     $defaults['frontClipping'] = 0;
     $defaults['backClipping'] = 0;
     $defaults['twist'] = 0;
     $defaults['mode'] = 0;
     parent::__construct(array_merge($defaults, $attributes));
 }
예제 #28
0
 public function reSite($verificodea, $siteID, $template_id = 0)
 {
     $_GET['siteID'] = $siteID;
     //return 999999;
     parent::__construct();
     /*if(!$this->validateParam($siteID,$verificodea))
       return 0;*/
     require_once __DIR__ . '/../class/GenerateHtmlClass.php';
     $_POST["publishType"] = "publishAll";
     $obj = new GenerateHtmlClass($siteID);
     //     	if($obj->countReleaseFile() > 10000){
     //     		return 2;
     //     	}
     // 		else{
     return $obj->releaseFile($template_id);
     // 		}
 }
예제 #29
0
 function testUnbind()
 {
     global $eArgs, $eData;
     $eArgs = $eData = null;
     $args = 'This is a test';
     $data = array(1, 2, 4, 5);
     $base = new BaseClass();
     $base->bind('firstevent', 'test_callback');
     $base->bind('secondevent', $data, 'test_callback');
     $base->unbind('firstevent');
     $base->trigger('firstevent', $args);
     $this->okFalse($eArgs == $args, 'Attempting to trigger first event after unbind()');
     $base->unbind('secondevent');
     $base->trigger('secondevent');
     $this->okFalse($eData === $data, 'Attempting to trigger second event after unbind()');
 }
예제 #30
0
 /**
  * 
  */
 public function __construct($options = array())
 {
     parent::__construct();
     if (array_key_exists('id', $options) === TRUE && strlen($options['id']) > 0) {
         $this->id = $options['id'];
     }
     if (array_key_exists('name', $options) === TRUE && strlen($options['name']) > 0) {
         $this->name = $options['name'];
     }
     if (array_key_exists('css_class', $options) === TRUE && strlen($options['css_class']) > 0) {
         $this->css_class = $options['css_class'];
     }
     if (array_key_exists('onclick', $options) === TRUE && strlen($options['onclick']) > 0) {
         $this->onclick = $options['onclick'];
     }
     if (array_key_exists('content', $options) === TRUE && strlen($options['content']) > 0) {
         $this->content = $options['content'];
     }
 }