ItemChildren.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Assignments class file.
  4. *
  5. * @author Spyros Soldatos <spyros@valor.gr>
  6. * @link http://code.google.com/p/srbac/
  7. */
  8. /**
  9. * Assignments model is the authManager model that controls which the assignments
  10. * between useers/roles/tasks and operations
  11. *
  12. * @author Spyros Soldatos <spyros@valor.gr>
  13. * @package srbac.models
  14. * @since 1.0.0
  15. */
  16. class ItemChildren extends CActiveRecord {
  17. /**
  18. * The followings are the available columns in table 'itemchildren':
  19. * @var string $parent
  20. * @var string $child
  21. */
  22. /**
  23. * Returns the static model of the specified AR class.
  24. * @return CActiveRecord the static model class
  25. */
  26. public static function model($className=__CLASS__) {
  27. return parent::model($className);
  28. }
  29. public function getDbConnection() {
  30. return Yii::app()->authManager->db;
  31. }
  32. /**
  33. * @return string the associated database table name
  34. */
  35. public function tableName() {
  36. return Yii::app()->authManager->itemChildTable;
  37. }
  38. /**
  39. * @return array validation rules for model attributes.
  40. */
  41. public function rules() {
  42. return array(
  43. array('parent,child','safe')
  44. );
  45. }
  46. /**
  47. * @return array relational rules.
  48. */
  49. public function relations() {
  50. return array(
  51. );
  52. }
  53. }