Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #1021 and preparation for #1012 #1022

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
### JetBrains template
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed from the projects .gitignore.

It should be part of your user specific gitignore (usually at ~/.gitignore configured via core.excludesfile).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jepp. You are right. My very own .gitignore should have not benn part of the commit.

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

test/fixtures/bookstore-packaged/build/
test/fixtures/bookstore/build/
test/fixtures/namespaced/build/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ protected function addProcessNestedSetQueries(&$script)
$script .= "
/**
* Execute queries that were saved to be run inside the save transaction
*
* @param PropelPDO \$con
*/
protected function processNestedSetQueries(\$con)
protected function processNestedSetQueries(PropelPDO \$con)
{
foreach (\$this->nestedSetQueries as \$query) {
\$query['arguments'][]= \$con;
Expand Down Expand Up @@ -457,7 +459,7 @@ protected function addIsDescendantOf(&$script)
/**
* Tests if node is a descendant of another node
*
* @param $objectClassname \$node Propel node object
* @param $objectClassname \$parent Propel node object
* @return bool
*/
public function isDescendantOf(\$parent)
Expand All @@ -482,7 +484,7 @@ protected function addIsAncestorOf(&$script)
/**
* Tests if node is a ancestor of another node
*
* @param $objectClassname \$node Propel node object
* @param $objectClassname \$child Propel node object
* @return bool
*/
public function isAncestorOf(\$child)
Expand Down Expand Up @@ -996,8 +998,8 @@ protected function addAddChild(&$script)
* are not persisted until the child object is saved.
*
* @param $objectClassname \$child Propel object for child node
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function addChild($objectClassname \$child)
{
Expand Down Expand Up @@ -1033,8 +1035,8 @@ protected function addInsertAsFirstChildOf(&$script)
* are not persisted until the current object is saved.
*
* @param $objectClassname \$parent Propel object for parent node
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function insertAsFirstChildOf(\$parent)
{
Expand Down Expand Up @@ -1078,8 +1080,8 @@ protected function addInsertAsLastChildOf(&$script)
* are not persisted until the current object is saved.
*
* @param $objectClassname \$parent Propel object for parent node
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function insertAsLastChildOf(\$parent)
{
Expand Down Expand Up @@ -1123,8 +1125,8 @@ protected function addInsertAsPrevSiblingOf(&$script)
* are not persisted until the current object is saved.
*
* @param $objectClassname \$sibling Propel object for parent node
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function insertAsPrevSiblingOf(\$sibling)
{
Expand Down Expand Up @@ -1165,8 +1167,8 @@ protected function addInsertAsNextSiblingOf(&$script)
* are not persisted until the current object is saved.
*
* @param $objectClassname \$sibling Propel object for parent node
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function insertAsNextSiblingOf(\$sibling)
{
Expand Down Expand Up @@ -1205,8 +1207,8 @@ protected function addMoveToFirstChildOf(&$script)
*
* @param $objectClassname \$parent Propel object for parent node
* @param PropelPDO \$con Connection to use.
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function moveToFirstChildOf(\$parent, PropelPDO \$con = null)
{
Expand Down Expand Up @@ -1235,8 +1237,8 @@ protected function addMoveToLastChildOf(&$script)
*
* @param $objectClassname \$parent Propel object for parent node
* @param PropelPDO \$con Connection to use.
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function moveToLastChildOf(\$parent, PropelPDO \$con = null)
{
Expand Down Expand Up @@ -1265,8 +1267,8 @@ protected function addMoveToPrevSiblingOf(&$script)
*
* @param $objectClassname \$sibling Propel object for sibling node
* @param PropelPDO \$con Connection to use.
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function moveToPrevSiblingOf(\$sibling, PropelPDO \$con = null)
{
Expand Down Expand Up @@ -1298,8 +1300,8 @@ protected function addMoveToNextSiblingOf(&$script)
*
* @param $objectClassname \$sibling Propel object for sibling node
* @param PropelPDO \$con Connection to use.
*
* @return $objectClassname The current Propel object
* @throws PropelException
*/
public function moveToNextSiblingOf(\$sibling, PropelPDO \$con = null)
{
Expand Down Expand Up @@ -1333,6 +1335,7 @@ protected function addMoveSubtreeTo(&$script)
* @param int \$destLeft Destination left value
* @param int \$levelDelta Delta to add to the levels
* @param PropelPDO \$con Connection to use.
* @throws Exception
*/
protected function moveSubtreeTo(\$destLeft, \$levelDelta" . ($this->behavior->useScope() ? ", \$targetScope = null" : "") . ", PropelPDO \$con = null)
{
Expand Down Expand Up @@ -1439,14 +1442,14 @@ protected function addDeleteDescendants(&$script)
* so existing $objectClassname instances are probably invalid (except for the current one)
*
* @param PropelPDO \$con Connection to use.
*
* @return int number of deleted nodes
* @throws Exception
*/
public function deleteDescendants(PropelPDO \$con = null)
{
if (\$this->isLeaf()) {
// save one query
return;
return 0;
}
if (\$con === null) {
\$con = Propel::getConnection($peerClassname::DATABASE_NAME, Propel::CONNECTION_READ);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public function staticAttributes($builder)
* Scope column for the set
*/
const SCOPE_COL = '" . $tableName . '.' . $this->getColumnConstant('scope_column') . "';
";
}else{
$script .= "
/**
* Scope column for the set
*/
const SCOPE_COL = null;
";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public function getScopeValue(\$returnNulls = true)
/**
* Wrap the setter for scope value
*
* @param mixed A array or a native type
* @param mixed \$v A array or a native type
* @return {$this->objectClassname}
*/
public function setScopeValue(\$v)
Expand Down Expand Up @@ -539,9 +539,8 @@ protected function addMoveToRank(&$script)
*
* @param integer \$newRank rank value
* @param PropelPDO \$con optional connection
*
* @return {$this->objectClassname} the current object
*
* @throws Exception
* @throws PropelException
*/
public function moveToRank(\$newRank, PropelPDO \$con = null)
Expand Down Expand Up @@ -636,8 +635,8 @@ protected function addMoveUp(&$script)
* Move the object higher in the list, i.e. exchanges its rank with the one of the previous object
*
* @param PropelPDO \$con optional connection
*
* @return {$this->objectClassname} the current object
* @throws Exception
*/
public function moveUp(PropelPDO \$con = null)
{
Expand Down Expand Up @@ -669,8 +668,8 @@ protected function addMoveDown(&$script)
* Move the object higher in the list, i.e. exchanges its rank with the one of the next object
*
* @param PropelPDO \$con optional connection
*
* @return {$this->objectClassname} the current object
* @throws Exception
*/
public function moveDown(PropelPDO \$con = null)
{
Expand Down Expand Up @@ -724,8 +723,8 @@ protected function addMoveToBottom(&$script)
* Move the object to the bottom of the list
*
* @param PropelPDO \$con optional connection
*
* @return integer the old object's rank
* @throws Exception
*/
public function moveToBottom(PropelPDO \$con = null)
{
Expand Down Expand Up @@ -759,8 +758,8 @@ protected function addRemoveFromList(&$script)
* The modifications are not persisted until the object is saved.
*
* @param PropelPDO \$con optional connection
*
* @return {$this->objectClassname} the current object
* @throws PropelException
*/
public function removeFromList(PropelPDO \$con = null)
{";
Expand Down Expand Up @@ -796,8 +795,10 @@ protected function addProcessSortableQueries(&$script)
$script .= "
/**
* Execute queries that were saved to be run inside the save transaction
*
* @param PropelPDO \$con
*/
protected function processSortableQueries(\$con)
protected function processSortableQueries(PropelPDO \$con)
{
foreach (\$this->sortableQueries as \$query) {
\$query['arguments'][]= \$con;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ protected function addGetMaxRank(&$script)
* @param int \$scope Scope to determine which suite to consider";
}
$script .= "
* @param PropelPDO optional connection
*
* @return integer highest position
* @param PropelPDO \$con optional connection
* @return int highest position
*/
public static function getMaxRank(" . ($useScope ? "\$scope = null, " : "") . "PropelPDO \$con = null)
{
Expand Down Expand Up @@ -268,8 +267,8 @@ protected function addReorder(&$script)
*
* @param array \$order id => rank pairs
* @param PropelPDO \$con optional connection
*
* @return boolean true if the reordering took place, false if a database problem prevented it
* @throws Exception
*/
public static function reorder(array \$order, PropelPDO \$con = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ protected function addOrderByRank(&$script)
* Using the default \$order, returns the item with the lowest rank first
*
* @param string \$order either Criteria::ASC (default) or Criteria::DESC
*
* @return " . $this->queryClassname . " The current query, for fluid interface
* @throws PropelException
*/
public function orderByRank(\$order = Criteria::ASC)
{
Expand Down Expand Up @@ -287,8 +287,7 @@ protected function addGetMaxRank(&$script)
";
}
$script .= "
* @param PropelPDO optional connection
*
* @param PropelPDO \$con optional connection
* @return integer highest position
*/
public function getMaxRank(" . ($useScope ? "$methodSignature, " : "") . "PropelPDO \$con = null)
Expand Down Expand Up @@ -326,9 +325,8 @@ protected function addGetMaxRankArray(&$script)
";
}
$script .= "
* @param PropelPDO optional connection
*
* @return integer highest position
* @param PropelPDO \$con optional connection
* @return int highest position
*/
public function getMaxRankArray(" . ($useScope ? "\$scope, " : "") . "PropelPDO \$con = null)
{
Expand Down Expand Up @@ -363,8 +361,8 @@ protected function addReorder(&$script)
*
* @param array \$order id => rank pairs
* @param PropelPDO \$con optional connection
*
* @return boolean true if the reordering took place, false if a database problem prevented it
* @throws Exception
*/
public function reorder(array \$order, PropelPDO \$con = null)
{
Expand Down
Loading