<?php

class Registration extends Zend_Db_Table_Abstract {
  protected $_name = 'necosuke_lpo_tran_registration';

  public function insert($data) {
    $data['hash'] = hash(
      'sha256',
      (string)time() . 'NeCoSuKe'. implode('', array_values($data))
    );
    $data['date'] = new Zend_Db_Expr('now()');
    $data['password'] = new Zend_Db_Expr(
      $this->getDefaultAdapter()->quoteInto('sha1(?)', $data['password'])
    );

    return parent::insert($data);
  }
}
