Skip to content

Commit

Permalink
improve notes. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
vistart committed Jun 7, 2017
1 parent 5af89bb commit 373bed0
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions traits/SubsidiaryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
use yii\base\InvalidConfigException;

/**
* SubsidiaryTrait.
* The Trait is used to help the model manage its subsidiary models.
*
* For example:
* ```php
* $user->addSubsidiaryClass("email", ["class" => Email::class]);
* $email = $user->createEmail(['content' => '[email protected]']);
* $email->save();
* ```
* @version 1.0
* @author vistart <[email protected]>
*/
Expand Down Expand Up @@ -72,7 +81,7 @@ public function addSubsidiaryClass($name, $config)

/**
* Remove subsidiary.
* @param string $name
* @param string $name Subsidiary name, case insensitive.
* @return boolean
*/
public function removeSubsidiary($name)
Expand All @@ -86,8 +95,8 @@ public function removeSubsidiary($name)
}

/**
* Get subsidiary class.
* @param string $name
* Get subsidiary class according name.
* @param string $name Subsidiary name, case insensitive.
* @return string
*/
public function getSubsidiaryClass($name)
Expand All @@ -101,7 +110,7 @@ public function getSubsidiaryClass($name)

/**
* Get subsidiaries.
* @param $name
* @param $name Subsidiary name, case insensitive.
* @param string $limit
* @param int $page
* @return null
Expand Down Expand Up @@ -199,9 +208,9 @@ public function create($className, $config = [], $loadDefault = true, $skipIfSet
}

/**
*
* @param string $name
* @param array $config
* Create subsidiary model.
* @param string $name Subsidiary name, case insensitive.
* @param array $config Subsidiary model configuration array.
* @return mixed
*/
public function createSubsidiary($name, $config)
Expand Down

0 comments on commit 373bed0

Please sign in to comment.