drupal_module__wing/WingBase.inc

39 lines
865 B
PHP

<?php
abstract class WingBase extends Entity {
public $changed = REQUEST_TIME;
public $created = REQUEST_TIME;
public $machine_name;
public $module = 'wing';
public $status = 0;
public $title = '';
public $entityType;
public $entityInfo;
public function __construct(array $values = array(), $entityType = NULL) {
parent::__construct($values, $entityType);
}
public function editForm() {
$form = array();
dsm($this);
$form['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#default_value' => $this->title,
);
$form['machine_name'] = array(
'#type' => 'machine_name',
'#machine_name' => array(
'exists' => "{$this->entityType}_exists",
'source' => array('title'),
),
'#default_value' => $this->machine_name,
);
return $form;
}
}