Skip to content

Commit

Permalink
fix several generated phpDoc, missing declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
havvg committed Jun 12, 2012
1 parent 66f9eda commit 94aae82
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Set to true (default) to use less memory.
*
* @return int the number of archived objects
* @throws PropelException
*/
public function archive($con = null, $useLittleMemory = true)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Enable/disable auto-archiving on delete for the next query.
*
* @param Boolean True if the query must archive deleted objects, false otherwise.
* @param boolean $archiveOnDelete True if the query must archive deleted objects, false otherwise.
*/
public function setArchiveOnDelete($archiveOnDelete)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Enable/disable auto-archiving on update for the next query.
*
* @param Boolean True if the query must archive updated objects, false otherwise.
* @param boolean $archiveOnUpdate True if the query must archive updated objects, false otherwise.
*/
public function setArchiveOnUpdate($archiveOnUpdate)
{
Expand Down
10 changes: 6 additions & 4 deletions generator/lib/behavior/sluggable/SluggableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ public function addCleanupSlugPart(&$script)
* Cleanup a string to make a slug of it
* Removes special characters, replaces blanks with a separator, and trim it
*
* @param string \$text the text to slugify
* @param string \$separator the separator used by slug
* @return string the slugified text
* @param string \$slug the text to slugify
* @param string \$replacement the separator used by slug
* @return string the slugified text
*/
protected static function cleanupSlugPart(\$slug, \$replacement = '" . $this->getParameter('replacement') . "')
{
Expand Down Expand Up @@ -239,7 +239,8 @@ public function addLimitSlugSize(&$script)
/**
* Make sure the slug is short enough to accomodate the column size
*
* @param string \$slug the slug to check
* @param string \$slug the slug to check
* @param int \$incrementReservedSpace the number of characters to keep empty
*
* @return string the truncated slug
*/
Expand All @@ -264,6 +265,7 @@ public function addMakeSlugUnique(&$script)
*
* @param string \$slug the slug to check
* @param string \$separator the separator used by slug
* @param int \$increment the count of occurences of the slug
* @return string the unique slug
*/
protected function makeSlugUnique(\$slug, \$separator = '" . $this->getParameter('separator') ."', \$increment = 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ protected function addIsVersioningNecessary(&$script)
/**
* Checks whether the current state must be recorded as a version
*
* @param PropelPDO \$con An optional PropelPDO connection to use.
*
* @return boolean
*/
public function isVersioningNecessary(\$con = null)
Expand Down Expand Up @@ -322,6 +324,7 @@ protected function addToVersion(&$script)
* @param PropelPDO \$con the connection to use
*
* @return {$ARclassName} The current object (for fluent API support)
* @throws PropelException - if no object with the given version can be found.
*/
public function toVersion(\$versionNumber, \$con = null)
{
Expand Down Expand Up @@ -473,7 +476,7 @@ protected function addIsLastVersion(&$script)
*
* @param PropelPDO \$con the connection to use
*
* @return Boolean
* @return boolean
*/
public function isLastVersion(\$con = null)
{
Expand Down Expand Up @@ -677,10 +680,13 @@ protected function addGetLastVersions(&$script)
/**
* retrieve the last \$number versions.
*
* @param Integer \$number the number of record to return.
* @return PropelCollection|array {$versionARClassname}[] List of {$versionARClassname} objects
* @param integer \$number the number of record to return.
* @param {$this->getVersionQueryClassName()}|Criteria \$criteria Additional criteria to filter.
* @param PropelPDO \$con An optional connection to use.
*
* @return PropelCollection|{$versionARClassname}[] List of {$versionARClassname} objects
*/
public function getLastVersions(\$number = 10, \$criteria = null, \$con = null)
public function getLastVersions(\$number = 10, \$criteria = null, PropelPDO \$con = null)
{
\$criteria = {$this->getVersionQueryClassName()}::create(null, \$criteria);
\$criteria->addDescendingOrderByColumn({$versionPeer}::VERSION);
Expand Down
43 changes: 34 additions & 9 deletions generator/lib/builder/om/PHP5ObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,20 @@ protected function addArrayAccessorBody(&$script, Column $col)
*/
protected function addEnumAccessor(&$script, Column $col)
{
$this->addDefaultAccessorComment($script, $col);
$clo = strtolower($col->getName());
$script .= "
/**
* Get the [$clo] column value.
* ".$col->getDescription();
if ($col->isLazyLoad()) {
$script .= "
* @param PropelPDO \$con An optional PropelPDO connection to use for fetching this lazy-loaded column.";
}
$script .= "
* @return ".$col->getPhpType()."
* @throws PropelException - if the stored enum key is unknown.
*/";

$this->addDefaultAccessorOpen($script, $col);
$this->addEnumAccessorBody($script, $col);
$this->addDefaultAccessorClose($script, $col);
Expand Down Expand Up @@ -1088,7 +1101,7 @@ protected function addHasArrayElement(&$script, Column $col)
* ".$col->getDescription();
if ($col->isLazyLoad()) {
$script .= "
* @param PropelPDO An optional PropelPDO connection to use for fetching this lazy-loaded column.";
* @param PropelPDO \$con An optional PropelPDO connection to use for fetching this lazy-loaded column.";
}
$script .= "
* @return boolean
Expand Down Expand Up @@ -1134,7 +1147,7 @@ public function addDefaultAccessorComment(&$script, Column $col)
* ".$col->getDescription();
if ($col->isLazyLoad()) {
$script .= "
* @param PropelPDO An optional PropelPDO connection to use for fetching this lazy-loaded column.";
* @param PropelPDO \$con An optional PropelPDO connection to use for fetching this lazy-loaded column.";
}
$script .= "
* @return ".$col->getPhpType()."
Expand Down Expand Up @@ -1223,7 +1236,7 @@ protected function addLazyLoaderComment(&$script, Column $col)
* the [$clo] column, since it is not populated by
* the hydrate() method.
*
* @param \$con PropelPDO (optional) The PropelPDO connection to use.
* @param PropelPDO \$con (optional) The PropelPDO connection to use.
* @return void
* @throws PropelException - any underlying error will be wrapped and re-thrown.
*/";
Expand Down Expand Up @@ -1638,7 +1651,7 @@ protected function addAddArrayElement(&$script, Column $col)
* ".$col->getDescription();
if ($col->isLazyLoad()) {
$script .= "
* @param PropelPDO An optional PropelPDO connection to use for fetching this lazy-loaded column.";
* @param PropelPDO \$con An optional PropelPDO connection to use for fetching this lazy-loaded column.";
}
$script .= "
* @return ".$this->getObjectClassname()." The current object (for fluent API support)
Expand Down Expand Up @@ -1676,7 +1689,7 @@ protected function addRemoveArrayElement(&$script, Column $col)
* ".$col->getDescription();
if ($col->isLazyLoad()) {
$script .= "
* @param PropelPDO An optional PropelPDO connection to use for fetching this lazy-loaded column.";
* @param PropelPDO \$con An optional PropelPDO connection to use for fetching this lazy-loaded column.";
}
$script .= "
* @return ".$this->getObjectClassname()." The current object (for fluent API support)
Expand Down Expand Up @@ -1710,7 +1723,17 @@ protected function addRemoveArrayElement(&$script, Column $col)
protected function addEnumMutator(&$script, Column $col)
{
$clo = strtolower($col->getName());
$this->addMutatorOpen($script, $col);

$script .= "
/**
* Set the value of [$clo] column.
* ".$col->getDescription()."
* @param ".$col->getPhpType()." \$v new value
* @return ".$this->getObjectClassname()." The current object (for fluent API support)
* @throws PropelException - if the value is not accepted by this enum.
*/";
$this->addMutatorOpenOpen($script, $col);
$this->addMutatorOpenBody($script, $col);

$script .= "
if (\$v !== null) {
Expand Down Expand Up @@ -2424,7 +2447,7 @@ public function setByName(\$name, \$value, \$type = BasePeer::$defaultKeyType)
{
\$pos = ".$this->getPeerClassname()."::translateFieldName(\$name, \$type, BasePeer::TYPE_NUM);
return \$this->setByPosition(\$pos, \$value);
\$this->setByPosition(\$pos, \$value);
}
";
}
Expand Down Expand Up @@ -2541,6 +2564,7 @@ protected function addDeleteComment(&$script)
* @param PropelPDO \$con
* @return void
* @throws PropelException
* @throws Exception
* @see BaseObject::setDeleted()
* @see BaseObject::isDeleted()
*/";
Expand Down Expand Up @@ -3455,7 +3479,7 @@ public function initRelation(\$relationName)
$relCol = $this->getRefFKPhpNameAffix($refFK, $plural = true);
$script .= "
if ('$relationName' == \$relationName) {
return \$this->init$relCol();
\$this->init$relCol();
}";
}
}
Expand Down Expand Up @@ -4778,6 +4802,7 @@ protected function addSaveComment(&$script)
$script .= "
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
* @throws PropelException
* @throws Exception
* @see doSave()
*/";
}
Expand Down
11 changes: 9 additions & 2 deletions generator/lib/builder/om/PHP5PeerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ protected function addGetFieldNames(&$script)
* One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
* @return array A list of field names
* @throws PropelException - if the type is not valid.
*/
public static function getFieldNames(\$type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists(\$type, self::\$fieldNames)) {
Expand Down Expand Up @@ -462,7 +462,6 @@ public static function translateFieldName(\$name, \$fromType, \$toType)
protected function addGetValueSets(&$script)
{
$this->declareClassFromBuilder($this->getTableMapBuilder());
$callingClass = $this->getStubPeerBuilder()->getClassname();
$script .= "
/**
* Gets the list of values for all ENUM columns
Expand All @@ -485,6 +484,9 @@ protected function addGetValueSet(&$script)
$script .= "
/**
* Gets the list of values for an ENUM column
*
* @param string \$colname The ENUM column name.
*
* @return array list of possible values for the column
*/
public static function getValueSet(\$colname)
Expand Down Expand Up @@ -864,6 +866,9 @@ protected function addRemoveInstanceFromPool(&$script)
* from the cache in order to prevent returning objects that no longer exist.
*
* @param mixed \$value A ".$this->getObjectClassname()." object or a primary key value.
*
* @return void
* @throws PropelException - if the value is invalid.
*/
public static function removeInstanceFromPool(\$value)
{";
Expand Down Expand Up @@ -1446,6 +1451,7 @@ protected function addDoDeleteAll(&$script)
*
* @param PropelPDO \$con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException
*/
public static function doDeleteAll(PropelPDO \$con = null)
{
Expand Down Expand Up @@ -1912,6 +1918,7 @@ protected function addRetrieveByPKs_SinglePK(&$script)
*
* @param array \$pks List of primary keys
* @param PropelPDO \$con the connection to use
* @return " .$this->getObjectClassname(). "[]
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
Expand Down
Loading

0 comments on commit 94aae82

Please sign in to comment.