Hi,

i need advice as to whether I'm  approaching something in the "right"
way.

I am building a grid form for timesheet entry.

my "main" partial is
<tr>
        <th scope="cal"><?php echo $activity_type ?></th>
        <?php $actid = $activity_type->getId(); ?>
        <?php $startday = $day->format('z'); ?>
  <?php for($cnt = 0; $cnt <= 6; $cnt++): ?>
                <?php $curday = $startday+$cnt; ?>
                <td><?php echo tag('input', array('name' =>  'activity[act][a'.
$actid.'][d'.$curday.']',
                'type' => 'text',
                'size' => '4',
                'value' => isset($activity->act['a'.$actid]['d'.$curday]) ?
$activity->act['a'.actid]['d'.$curday] : null  )) ?>
</td>

  <?php endfor ?>

</tr>

my start of an action class is
class activityActions extends autoactivityActions
{
        public function executeAddlog()
  {
                $this->activity = $this->getActivityOrCreate();
    $this->activity->setConsumerId($this-
>hasRequestParameter('consumer_id') ? $this-
>getRequestParameter('consumer_id') : null);
    $this->activity->week = $this->hasRequestParameter('week') ? $this-
>getRequestParameter('week') : null;
    $this->activity->act = $this->hasRequestParameter('act') ? $this-
>getRequestParameter('act') : null;
          $this->labels = $this->getLabels();
  }


}

the schema for the activity table is:
        <table name="Activity" skipSql="null" abstract="null">
         <column name="id" autoIncrement="true" type="INTEGER"
required="true" primaryKey="true" autoincrement="true"/>
   <column name="consumer_id" type="INTEGER" />
   <foreign-key foreignTable="Consumer">
     <reference local="consumer_id" foreign="id"/>
   </foreign-key>
         <column name="staff_id" type="INTEGER"/>
         <foreign-key foreignTable="Contact" onDelete="none" onUpdate="none">
                <reference local="staff_id" foreign="id"/>
         </foreign-key>
         <column name="activitytype_id" type="INTEGER" />
         <foreign-key foreignTable="ActivityType" onDelete="none"
onUpdate="none">
                <reference local="activitytype_id" foreign="id"/>
         </foreign-key>
         <column name="day" type="INTEGER" />
         <column name="hours" type="FLOAT" />
        </table>

should I add setAct and  getAct to activity?

is there a better way?

thanks for all ideas.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to