Entity.php 795 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Entity superclass.
  4. *
  5. * Every other entity must inherit from this one. It represents a database
  6. * entity.
  7. */
  8. abstract class Entity{
  9. /**
  10. * Database connection.
  11. */
  12. public $db;
  13. /**
  14. * The language of the class's text fields (lowercase, two-letter
  15. * language code).
  16. */
  17. public $lang;
  18. /**
  19. * Constructor.
  20. *
  21. * Sets the database conection and the language.
  22. *
  23. * @param MySQL_connection $db Connection to the database.
  24. * @param string $lang Lowercase, two-letter language code.
  25. */
  26. public function __construct($db, $lang){
  27. $this->db = $db;
  28. $this->lang = $lang;
  29. }
  30. }
  31. ?>