DBKey.php 1002 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /** @package verysimple::DB::Reflection */
  3. /**
  4. * DBSet is an object representation of foreign key
  5. *
  6. * @package verysimple::DB::Reflection
  7. * @author Jason Hinkle
  8. * @copyright 1997-2007 VerySimple, Inc.
  9. * @license http://www.gnu.org/licenses/lgpl.html LGPL
  10. * @version 1.0
  11. */
  12. class DBKey
  13. {
  14. public $Table;
  15. public $Name;
  16. public $NameNoPrefix;
  17. public $GetterName;
  18. public $KeyColumn;
  19. public $KeyComment;
  20. /**
  21. * Instantiate new DBSet
  22. *
  23. * @access public
  24. * @param DBTable $table that is the dependent/child table
  25. * @param string $keyname
  26. * @param string $columnname
  27. */
  28. function __construct($table, $keyname, $columnname)
  29. {
  30. $this->Table =& $table;
  31. $this->Name = $keyname;
  32. $this->KeyColumn = str_replace("`","", $columnname);
  33. $this->KeyComment = $this->Table->Columns[$this->KeyColumn]->Comment;
  34. $this->NameNoPrefix = $this->Table->RemovePrefix($this->Name);
  35. $this->GetterName = $this->NameNoPrefix;
  36. }
  37. }
  38. ?>