Skip to content

Commit

Permalink
schema update
Browse files Browse the repository at this point in the history
  • Loading branch information
ptdtv8yr committed Jan 28, 2007
1 parent 65bc1e5 commit 24177e9
Show file tree
Hide file tree
Showing 14 changed files with 192 additions and 74 deletions.
4 changes: 3 additions & 1 deletion app/config/factories.xml
Expand Up @@ -37,7 +37,9 @@

<configuration context="ircbot">

<controller class="ChuckwallaIrcbotController" />
<controller class="ChuckwallaIrcbotController">
<parameter name="max_executions">0</parameter>
</controller>

<database_manager class="AgaviDatabaseManager" />

Expand Down
2 changes: 1 addition & 1 deletion app/lib/chuckwallaom/map/ChuckwallaChannelMapBuilder.php
Expand Up @@ -7,7 +7,7 @@
*
* This class was autogenerated by Propel 1.3.0-dev on:
*
* 01/28/07 04:28:34
* 01/28/07 06:03:51
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
Expand Down
Expand Up @@ -7,7 +7,7 @@
*
* This class was autogenerated by Propel 1.3.0-dev on:
*
* 01/28/07 04:28:34
* 01/28/07 06:03:51
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
Expand Down
2 changes: 1 addition & 1 deletion app/lib/chuckwallaom/map/ChuckwallaCommandsMapBuilder.php
Expand Up @@ -7,7 +7,7 @@
*
* This class was autogenerated by Propel 1.3.0-dev on:
*
* 01/28/07 04:28:35
* 01/28/07 06:03:52
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
Expand Down
Expand Up @@ -7,7 +7,7 @@
*
* This class was autogenerated by Propel 1.3.0-dev on:
*
* 01/28/07 04:28:34
* 01/28/07 06:03:51
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
Expand Down
4 changes: 3 additions & 1 deletion app/lib/chuckwallaom/map/ChuckwallaMessageLogMapBuilder.php
Expand Up @@ -7,7 +7,7 @@
*
* This class was autogenerated by Propel 1.3.0-dev on:
*
* 01/28/07 04:28:35
* 01/28/07 06:03:52
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
Expand Down Expand Up @@ -76,6 +76,8 @@ public function doBuild()

$tMap->addColumn('MESSAGE', 'Message', 'LONGVARCHAR', true);

$tMap->addColumn('MESSAGE_DATE', 'MessageDate', 'TIMESTAMP', true);

} // doBuild()

} // ChuckwallaMessageLogMapBuilder
2 changes: 1 addition & 1 deletion app/lib/chuckwallaom/map/ChuckwallaNickMapBuilder.php
Expand Up @@ -7,7 +7,7 @@
*
* This class was autogenerated by Propel 1.3.0-dev on:
*
* 01/28/07 04:28:35
* 01/28/07 06:03:51
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
Expand Down
2 changes: 1 addition & 1 deletion app/lib/chuckwallaom/map/ChuckwallaUserMapBuilder.php
Expand Up @@ -7,7 +7,7 @@
*
* This class was autogenerated by Propel 1.3.0-dev on:
*
* 01/28/07 04:28:35
* 01/28/07 06:03:52
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
Expand Down
76 changes: 75 additions & 1 deletion app/lib/chuckwallaom/om/ChuckwallaBaseMessageLog.php
Expand Up @@ -57,6 +57,13 @@ public function getContext()
*/
protected $message;


/**
* The value for the message_date field.
* @var int
*/
protected $message_date;

/**
* @var Channel
*/
Expand Down Expand Up @@ -136,6 +143,37 @@ public function getMessage()
return $this->message;
}

/**
* Get the [optionally formatted] [message_date] column value.
*
* @param string $format The date/time format string (either date()-style or strftime()-style).
* If format is NULL, then the integer unix timestamp will be returned.
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
* @throws PropelException - if unable to convert the date/time to timestamp.
*/
public function getMessageDate($format = 'Y-m-d H:i:s')
{

if ($this->message_date === null || $this->message_date === '') {
return null;
} elseif (!is_int($this->message_date)) {
// a non-timestamp value was set externally, so we convert it
$ts = strtotime($this->message_date);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse value of [message_date] as date/time value: " . var_export($this->message_date, true));
}
} else {
$ts = $this->message_date;
}
if ($format === null) {
return $ts;
} elseif (strpos($format, '%') !== false) {
return strftime($format, $ts);
} else {
return date($format, $ts);
}
}

/**
* Set the value of [id] column.
*
Expand Down Expand Up @@ -224,6 +262,30 @@ public function setMessage($v)

} // setMessage()

/**
* Set the value of [message_date] column.
*
* @param int $v new value
* @return void
*/
public function setMessageDate($v)
{

if ($v !== null && !is_int($v)) {
$ts = strtotime($v);
if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
throw new PropelException("Unable to parse date/time value for [message_date] from input: " . var_export($v, true));
}
} else {
$ts = $v;
}
if ($this->message_date !== $ts) {
$this->message_date = $ts;
$this->modifiedColumns[] = ChuckwallaMessageLogPeer::MESSAGE_DATE;
}

} // setMessageDate()

/**
* Hydrates (populates) the object variables with values from the database resultset.
*
Expand All @@ -246,12 +308,13 @@ public function hydrate($row, $startcol = 0)
$this->nick_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
$this->channel_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
$this->message = $row[$startcol + 4];
$this->message_date = $row[$startcol + 5]; // FIXME - this is a timestamp, we should maybe convert it (?)
$this->resetModified();

$this->setNew(false);

// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 5; // 5 = ChuckwallaMessageLogPeer::NUM_COLUMNS - ChuckwallaMessageLogPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 6; // 6 = ChuckwallaMessageLogPeer::NUM_COLUMNS - ChuckwallaMessageLogPeer::NUM_LAZY_LOAD_COLUMNS).

} catch (Exception $e) {
throw new PropelException("Error populating MessageLog object", $e);
Expand Down Expand Up @@ -510,6 +573,9 @@ public function getByPosition($pos)
case 4:
return $this->getMessage();
break;
case 5:
return $this->getMessageDate();
break;
default:
return null;
break;
Expand All @@ -535,6 +601,7 @@ public function toArray($keyType = BasePeer::TYPE_PHPNAME)
$keys[2] => $this->getNickId(),
$keys[3] => $this->getChannelId(),
$keys[4] => $this->getMessage(),
$keys[5] => $this->getMessageDate(),
);
return $result;
}
Expand Down Expand Up @@ -581,6 +648,9 @@ public function setByPosition($pos, $value)
case 4:
$this->setMessage($value);
break;
case 5:
$this->setMessageDate($value);
break;
} // switch()
}

Expand Down Expand Up @@ -609,6 +679,7 @@ public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
if (array_key_exists($keys[2], $arr)) $this->setNickId($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setChannelId($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setMessage($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setMessageDate($arr[$keys[5]]);
}

/**
Expand All @@ -625,6 +696,7 @@ public function buildCriteria()
if ($this->isColumnModified(ChuckwallaMessageLogPeer::NICK_ID)) $criteria->add(ChuckwallaMessageLogPeer::NICK_ID, $this->nick_id);
if ($this->isColumnModified(ChuckwallaMessageLogPeer::CHANNEL_ID)) $criteria->add(ChuckwallaMessageLogPeer::CHANNEL_ID, $this->channel_id);
if ($this->isColumnModified(ChuckwallaMessageLogPeer::MESSAGE)) $criteria->add(ChuckwallaMessageLogPeer::MESSAGE, $this->message);
if ($this->isColumnModified(ChuckwallaMessageLogPeer::MESSAGE_DATE)) $criteria->add(ChuckwallaMessageLogPeer::MESSAGE_DATE, $this->message_date);

return $criteria;
}
Expand Down Expand Up @@ -687,6 +759,8 @@ public function copyInto($copyObj, $deepCopy = false)

$copyObj->setMessage($this->message);

$copyObj->setMessageDate($this->message_date);


$copyObj->setNew(true);

Expand Down
23 changes: 14 additions & 9 deletions app/lib/chuckwallaom/om/ChuckwallaBaseMessageLogPeer.php
Expand Up @@ -24,7 +24,7 @@ public function getContext()
const CLASS_DEFAULT = 'chuckwallaom.ChuckwallaMessageLog';

/** The total number of columns. */
const NUM_COLUMNS = 5;
const NUM_COLUMNS = 6;

/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
Expand All @@ -45,6 +45,9 @@ public function getContext()
/** the column name for the MESSAGE field */
const MESSAGE = 'message_log.MESSAGE';

/** the column name for the MESSAGE_DATE field */
const MESSAGE_DATE = 'message_log.MESSAGE_DATE';

/**
* An identiy map to hold any loaded instances of ChuckwallaMessageLog objects.
* This must be public so that other peer classes can access this when hydrating from JOIN
Expand All @@ -66,10 +69,10 @@ public function getContext()
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Type', 'NickId', 'ChannelId', 'Message', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::TYPE, self::NICK_ID, self::CHANNEL_ID, self::MESSAGE, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'type', 'nick_id', 'channel_id', 'message', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
BasePeer::TYPE_PHPNAME => array ('Id', 'Type', 'NickId', 'ChannelId', 'Message', 'MessageDate', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::TYPE, self::NICK_ID, self::CHANNEL_ID, self::MESSAGE, self::MESSAGE_DATE, ),
BasePeer::TYPE_FIELDNAME => array ('id', 'type', 'nick_id', 'channel_id', 'message', 'message_date', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);

/**
Expand All @@ -79,10 +82,10 @@ public function getContext()
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Type' => 1, 'NickId' => 2, 'ChannelId' => 3, 'Message' => 4, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::TYPE => 1, self::NICK_ID => 2, self::CHANNEL_ID => 3, self::MESSAGE => 4, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'type' => 1, 'nick_id' => 2, 'channel_id' => 3, 'message' => 4, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Type' => 1, 'NickId' => 2, 'ChannelId' => 3, 'Message' => 4, 'MessageDate' => 5, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::TYPE => 1, self::NICK_ID => 2, self::CHANNEL_ID => 3, self::MESSAGE => 4, self::MESSAGE_DATE => 5, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'type' => 1, 'nick_id' => 2, 'channel_id' => 3, 'message' => 4, 'message_date' => 5, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);

/**
Expand Down Expand Up @@ -174,6 +177,8 @@ public static function addSelectColumns(Criteria $criteria)

$criteria->addSelectColumn(ChuckwallaMessageLogPeer::MESSAGE);

$criteria->addSelectColumn(ChuckwallaMessageLogPeer::MESSAGE_DATE);

}

const COUNT = 'COUNT(message_log.ID)';
Expand Down
2 changes: 1 addition & 1 deletion app/modules/Bot/lib/view/ChuckwallaBotBaseView.class.php
Expand Up @@ -3,7 +3,7 @@
class ChuckwallaBotBaseView extends ChuckwallaBaseView
{
public function setupIrc(AgaviRequestDataHolder $rd)
{echo "setup\n\n\n\n\n";
{
$this->loadLayout();

$ircR = $this->getContext()->getRequest()->getAttribute('irc_request', 'org.agavi.Chuckwalla.irc_params');
Expand Down

0 comments on commit 24177e9

Please sign in to comment.