PageRenderTime 54ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/classes/blib/object.php

https://bitbucket.org/Balancer/bors-core
PHP | 27 lines | 17 code | 7 blank | 3 comment | 0 complexity | 8c75ff112892c17c79aafb8278116a08 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-3.0
  1. <?php
  2. class blib_object
  3. {
  4. protected $_value = NULL;
  5. function val() { return $this->_value; }
  6. function value() { return $this->_value; }
  7. function __construct($init_value = NULL)
  8. {
  9. $this->_value = $init_value;
  10. }
  11. // Значение есть, но пустое
  12. function is_empty() { return empty($this->_value); }
  13. // Значение отсутствует
  14. function is_null() { return is_null($this->_value); }
  15. function is_not_null() { return !is_null($this->_value); }
  16. // Значение есть и не пустое
  17. function is_value() { return !empty($this->_value); }
  18. function is_array() { return false; }
  19. function to_array() { return array($this->_value); }
  20. }