WingBase.inc 865 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. abstract class WingBase extends Entity {
  3. public $changed = REQUEST_TIME;
  4. public $created = REQUEST_TIME;
  5. public $machine_name;
  6. public $module = 'wing';
  7. public $status = 0;
  8. public $title = '';
  9. public $entityType;
  10. public $entityInfo;
  11. public function __construct(array $values = array(), $entityType = NULL) {
  12. parent::__construct($values, $entityType);
  13. }
  14. public function editForm() {
  15. $form = array();
  16. dsm($this);
  17. $form['title'] = array(
  18. '#type' => 'textfield',
  19. '#title' => t('Title'),
  20. '#default_value' => $this->title,
  21. );
  22. $form['machine_name'] = array(
  23. '#type' => 'machine_name',
  24. '#machine_name' => array(
  25. 'exists' => "{$this->entityType}_exists",
  26. 'source' => array('title'),
  27. ),
  28. '#default_value' => $this->machine_name,
  29. );
  30. return $form;
  31. }
  32. }