Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch '2.6' into 2.7
Browse files Browse the repository at this point in the history
* 2.6:
  Use PHPUnit ini_set wrapper in tests
  [Process] Added a test skip check for Windows
  [Process] Removed unused variable assignment
  Fixes various phpdoc and coding standards.
  Fixes Issue #13184 - incremental output getters now return empty strings
  Updated copyright to 2015
  Updated copyright to 2015
  Updated copyright to 2015
  [VarDumper] increase debug.max_items to 2500
  [Debug] Update exception messages.
  use value of DIRECTORY_SEPARATOR to detect Windows
  force ExpressionLanguage version >= 2.6
  [Debug] fixes ClassNotFoundFatalErrorHandler to correctly handle class not found errors with Symfony ClassLoader component autoloaders.
  Clarify a comment.
  use PHP_WINDOWS_VERSION_BUILD to detect Windows
  Check if a field type_class is defined before using it.
  Currently if you want to use inline bootstrap form rendering, this is usually enough:

Conflicts:
	src/Symfony/Component/Debug/composer.json
  • Loading branch information
fabpot committed Jan 3, 2015
2 parents 0c8978a + c4a7d4d commit 9d510fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions Form/ChoiceList/ModelChoiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace Symfony\Bridge\Propel1\Form\ChoiceList;

use ModelCriteria;
use BaseObject;
use Persistent;
use Symfony\Bridge\Propel1\Form\Type\ModelType;
use Symfony\Component\Form\Exception\StringCastException;
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
use Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer;
use Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer;
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
Expand All @@ -40,14 +40,14 @@ class ModelChoiceList extends ObjectChoiceList
/**
* The query to retrieve the choices of this list.
*
* @var ModelCriteria
* @var \ModelCriteria
*/
protected $query;

/**
* The query to retrieve the preferred choices for this list.
*
* @var ModelCriteria
* @var \ModelCriteria
*/
protected $preferredQuery;

Expand All @@ -68,16 +68,16 @@ class ModelChoiceList extends ObjectChoiceList
/**
* Constructor.
*
* @see \Symfony\Bridge\Propel1\Form\Type\ModelType How to use the preferred choices.
* @see ModelType How to use the preferred choices.
*
* @param string $class The FQCN of the model class to be loaded.
* @param string $labelPath A property path pointing to the property used for the choice labels.
* @param array $choices An optional array to use, rather than fetching the models.
* @param ModelCriteria $queryObject The query to use retrieving model data from database.
* @param \ModelCriteria $queryObject The query to use retrieving model data from database.
* @param string $groupPath A property path pointing to the property used to group the choices.
* @param array|ModelCriteria $preferred The preferred items of this choice.
* @param array|\ModelCriteria $preferred The preferred items of this choice.
* Either an array if $choices is given,
* or a ModelCriteria to be merged with the $queryObject.
* or a \ModelCriteria to be merged with the $queryObject.
* @param PropertyAccessorInterface $propertyAccessor The reflection graph for reading property paths.
* @param string $useAsIdentifier a custom unique column (eg slug) to use instead of primary key.
*
Expand Down Expand Up @@ -107,7 +107,7 @@ public function __construct($class, $labelPath = null, $choices = null, $queryOb

$this->loaded = is_array($choices) || $choices instanceof \Traversable;

if ($preferred instanceof ModelCriteria) {
if ($preferred instanceof \ModelCriteria) {
$this->preferredQuery = $preferred->mergeWith($this->query);
}

Expand Down Expand Up @@ -190,8 +190,8 @@ public function getChoicesForValues(array $values)
* * The choice option "expanded" is set to false.
* * The current request is the submission of the selected value.
*
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer::reverseTransform
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer::reverseTransform
* @see ChoicesToValuesTransformer::reverseTransform()
* @see ChoiceToValueTransformer::reverseTransform()
*/
if (!$this->loaded) {
if (1 === count($this->identifier)) {
Expand Down Expand Up @@ -245,8 +245,8 @@ public function getValuesForChoices(array $models)
* It correlates with the performance optimization in {@link ModelChoiceList::getChoicesForValues()}
* as it won't load the actual entries from the database.
*
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer::transform
* @see \Symfony\Component\Form\Extension\Core\DataTransformer\ChoiceToValueTransformer::transform
* @see ChoicesToValuesTransformer::transform()
* @see ChoiceToValueTransformer::transform()
*/
if (1 === count($this->identifier)) {
$values = array();
Expand Down Expand Up @@ -414,7 +414,7 @@ private function load()
$models = (array) $this->query->find();

$preferred = array();
if ($this->preferredQuery instanceof ModelCriteria) {
if ($this->preferredQuery instanceof \ModelCriteria) {
$preferred = (array) $this->preferredQuery->find();
}

Expand Down Expand Up @@ -453,12 +453,12 @@ private function getIdentifierValues($model)
}
}

if ($model instanceof Persistent) {
if ($model instanceof \Persistent) {
return array($model->getPrimaryKey());
}

// readonly="true" models do not implement Persistent.
if ($model instanceof BaseObject && method_exists($model, 'getPrimaryKey')) {
// readonly="true" models do not implement \Persistent.
if ($model instanceof \BaseObject && method_exists($model, 'getPrimaryKey')) {
return array($model->getPrimaryKey());
}

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2004-2014 Fabien Potencier
Copyright (c) 2004-2015 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 9d510fb

Please sign in to comment.