Skip to content

Commit

Permalink
Adding doc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 10, 2016
1 parent ed38b1c commit dbbf698
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/ORM/Association/Loader/SelectLoader.php
Expand Up @@ -27,24 +27,74 @@
class SelectLoader
{

/**
* The alias of the association loading the results
*
* @var string
*/
protected $alias;

/**
* The alias of the source association
*
* @var string
*/
protected $sourceAlias;

/**
* The alias of the target association
*
* @var string
*/
protected $targetAlias;

/**
* The foreignKey to the target association
*
* @var string|array
*/
protected $foreignKey;

/**
* The strategy to use for loading, either select or subquery
*
* @var string
*/
protected $strategy = 'select';

/**
* The binding key for the source association.
*
* @var string
*/
protected $bindingKey;

/**
* A callable that will return a query object used for loading the association results
*
* @var callable
*/
protected $finder;

/**
* The type of the association triggering the load
*
* @var string
*/
protected $associationType;

/**
* The sorting options for loading the association
*
* @var string
*/
protected $sort;

/**
* Copies the options array to properties in this class. The keys in the array correspond
* to properties in this class.
*
*/
public function __construct(array $options)
{
$this->alias = $options['alias'];
Expand All @@ -59,6 +109,13 @@ public function __construct(array $options)
}


/**
* Returns a callable that can be used for injecting association results into a given
* iterator. The options accepted by this method are the same as `Association::eagerLoader()`
*
* @param array $options Same options as `Association::eagerLoader()`
* @return callable
*/
public function buildLoadingQuery(array $options)
{
$options += $this->_defaultOptions();
Expand Down
20 changes: 20 additions & 0 deletions src/ORM/Association/Loader/SelectWithPivotLoader.php
Expand Up @@ -23,12 +23,32 @@
class SelectWithPivotLoader extends SelectLoader
{

/**
* The name of the junction association
*
* @var string
*/
protected $junctionAssociationName;

/**
* The property name for the junction association, where its results should be nested at.
*
* @var string
*/
protected $junctionProperty;

/**
* The junction association instance
*
* @var \Cake\ORM\Association\HasMany
*/
protected $junctionAssoc;

/**
* Custom conditions for the junction association
*
* @var mixed
*/
protected $junctionConditions;

/**
Expand Down

0 comments on commit dbbf698

Please sign in to comment.