@@ -12,8 +12,8 @@ |
||
| 12 | 12 | use craft\elements\User; |
| 13 | 13 | use craft\events\SetElementTableAttributeHtmlEvent; |
| 14 | 14 | use craft\helpers\Html; |
| 15 | -use flipbox\organizations\behaviors\OrganizationsAssociatedToUserBehavior; |
|
| 16 | 15 | use flipbox\organizations\Organizations; |
| 16 | +use flipbox\organizations\behaviors\OrganizationsAssociatedToUserBehavior; |
|
| 17 | 17 | use flipbox\organizations\records\UserAssociation; |
| 18 | 18 | use flipbox\organizations\records\UserType; |
| 19 | 19 | |
@@ -9,10 +9,10 @@ |
||
| 9 | 9 | namespace flipbox\organizations\relationships; |
| 10 | 10 | |
| 11 | 11 | use Craft; |
| 12 | +use Tightenco\Collect\Support\Collection; |
|
| 12 | 13 | use craft\base\ElementInterface; |
| 13 | 14 | use craft\helpers\ArrayHelper; |
| 14 | 15 | use flipbox\organizations\records\UserAssociation; |
| 15 | -use Tightenco\Collect\Support\Collection; |
|
| 16 | 16 | use yii\base\Exception; |
| 17 | 17 | use yii\db\ActiveRecord; |
| 18 | 18 | use yii\db\QueryInterface; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @param $objects |
| 139 | 139 | * @param array $attributes |
| 140 | - * @return RelationshipInterface |
|
| 140 | + * @return RelationshipTrait |
|
| 141 | 141 | */ |
| 142 | 142 | public function add($objects, array $attributes = []): RelationshipInterface |
| 143 | 143 | { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | /** |
| 152 | 152 | * @param $object |
| 153 | 153 | * @param array $attributes |
| 154 | - * @return RelationshipInterface |
|
| 154 | + * @return RelationshipTrait |
|
| 155 | 155 | */ |
| 156 | 156 | private function addOne($object, array $attributes = []): RelationshipInterface |
| 157 | 157 | { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | /** |
| 189 | 189 | * @param $objects |
| 190 | - * @return RelationshipInterface |
|
| 190 | + * @return RelationshipTrait |
|
| 191 | 191 | */ |
| 192 | 192 | public function remove($objects): RelationshipInterface |
| 193 | 193 | { |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | /** |
| 245 | 245 | * Reset associations |
| 246 | - * @return RelationshipInterface |
|
| 246 | + * @return RelationshipTrait |
|
| 247 | 247 | */ |
| 248 | 248 | public function reset(): RelationshipInterface |
| 249 | 249 | { |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | /** |
| 256 | 256 | * Reset associations |
| 257 | - * @return RelationshipInterface |
|
| 257 | + * @return RelationshipTrait |
|
| 258 | 258 | */ |
| 259 | 259 | public function clear(): RelationshipInterface |
| 260 | 260 | { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | * Update a relation that's already association. |
| 336 | 336 | * |
| 337 | 337 | * @param Collection $collection |
| 338 | - * @param $association |
|
| 338 | + * @param ActiveRecord $association |
|
| 339 | 339 | */ |
| 340 | 340 | protected function updateCollection(Collection $collection, $association) |
| 341 | 341 | { |
@@ -227,8 +227,8 @@ |
||
| 227 | 227 | *******************************************/ |
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | - * @param UserAssociation|Organization|int|array|null $object |
|
| 231 | - * @return int|null |
|
| 230 | + * @param UserAssociation $object |
|
| 231 | + * @return string |
|
| 232 | 232 | */ |
| 233 | 233 | protected function findKey($object = null) |
| 234 | 234 | { |
@@ -8,16 +8,15 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace flipbox\organizations\relationships; |
| 10 | 10 | |
| 11 | -use craft\elements\db\ElementQueryInterface; |
|
| 11 | +use Tightenco\Collect\Support\Collection; |
|
| 12 | 12 | use craft\elements\User; |
| 13 | +use craft\elements\db\ElementQueryInterface; |
|
| 13 | 14 | use craft\helpers\ArrayHelper; |
| 14 | -use flipbox\organizations\elements\Organization; |
|
| 15 | 15 | use flipbox\organizations\Organizations; |
| 16 | +use flipbox\organizations\elements\Organization; |
|
| 16 | 17 | use flipbox\organizations\queries\OrganizationQuery; |
| 17 | 18 | use flipbox\organizations\queries\UserAssociationQuery; |
| 18 | 19 | use flipbox\organizations\records\UserAssociation; |
| 19 | -use Tightenco\Collect\Support\Collection; |
|
| 20 | -use yii\db\QueryInterface; |
|
| 21 | 20 | |
| 22 | 21 | /** |
| 23 | 22 | * Manages Organizations associated to Users |
@@ -8,16 +8,13 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace flipbox\organizations\relationships; |
| 10 | 10 | |
| 11 | +use Tightenco\Collect\Support\Collection; |
|
| 11 | 12 | use craft\helpers\ArrayHelper; |
| 12 | -use craft\helpers\Json; |
|
| 13 | -use flipbox\craft\ember\helpers\QueryHelper; |
|
| 14 | -use flipbox\organizations\elements\Organization; |
|
| 15 | 13 | use flipbox\organizations\Organizations; |
| 14 | +use flipbox\organizations\elements\Organization; |
|
| 16 | 15 | use flipbox\organizations\queries\OrganizationTypeAssociationQuery; |
| 17 | 16 | use flipbox\organizations\records\OrganizationType; |
| 18 | 17 | use flipbox\organizations\records\OrganizationTypeAssociation; |
| 19 | -use flipbox\organizations\records\UserAssociation; |
|
| 20 | -use Tightenco\Collect\Support\Collection; |
|
| 21 | 18 | |
| 22 | 19 | /** |
| 23 | 20 | * Manages Organization Types associated to Organizations |
@@ -210,8 +210,8 @@ |
||
| 210 | 210 | *******************************************/ |
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | - * @param OrganizationTypeAssociation|OrganizationType|int|array|null $object |
|
| 214 | - * @return int|null |
|
| 213 | + * @param OrganizationTypeAssociation $object |
|
| 214 | + * @return string |
|
| 215 | 215 | */ |
| 216 | 216 | protected function findKey($object = null) |
| 217 | 217 | { |
@@ -219,8 +219,8 @@ |
||
| 219 | 219 | *******************************************/ |
| 220 | 220 | |
| 221 | 221 | /** |
| 222 | - * @param UserAssociation|User|int|array|null $object |
|
| 223 | - * @return int|null |
|
| 222 | + * @param UserAssociation $object |
|
| 223 | + * @return string |
|
| 224 | 224 | */ |
| 225 | 225 | protected function findKey($object = null) |
| 226 | 226 | { |
@@ -8,16 +8,15 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace flipbox\organizations\relationships; |
| 10 | 10 | |
| 11 | +use Tightenco\Collect\Support\Collection; |
|
| 12 | +use craft\elements\User; |
|
| 11 | 13 | use craft\elements\db\ElementQueryInterface; |
| 12 | 14 | use craft\elements\db\UserQuery; |
| 13 | -use craft\elements\User; |
|
| 14 | 15 | use craft\helpers\ArrayHelper; |
| 15 | -use flipbox\organizations\elements\Organization; |
|
| 16 | 16 | use flipbox\organizations\Organizations; |
| 17 | -use flipbox\organizations\queries\OrganizationQuery; |
|
| 17 | +use flipbox\organizations\elements\Organization; |
|
| 18 | 18 | use flipbox\organizations\queries\UserAssociationQuery; |
| 19 | 19 | use flipbox\organizations\records\UserAssociation; |
| 20 | -use Tightenco\Collect\Support\Collection; |
|
| 21 | 20 | |
| 22 | 21 | /** |
| 23 | 22 | * Manages Users associated to Organizations |
@@ -8,17 +8,12 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace flipbox\organizations\relationships; |
| 10 | 10 | |
| 11 | +use Tightenco\Collect\Support\Collection; |
|
| 11 | 12 | use craft\helpers\ArrayHelper; |
| 12 | -use craft\helpers\Json; |
|
| 13 | -use flipbox\craft\ember\helpers\QueryHelper; |
|
| 14 | -use flipbox\organizations\Organizations; |
|
| 15 | 13 | use flipbox\organizations\queries\UserTypeAssociationQuery; |
| 16 | -use flipbox\organizations\records\OrganizationType; |
|
| 17 | -use flipbox\organizations\records\OrganizationTypeAssociation; |
|
| 18 | 14 | use flipbox\organizations\records\UserAssociation; |
| 19 | 15 | use flipbox\organizations\records\UserType; |
| 20 | 16 | use flipbox\organizations\records\UserTypeAssociation; |
| 21 | -use Tightenco\Collect\Support\Collection; |
|
| 22 | 17 | |
| 23 | 18 | /** |
| 24 | 19 | * Manages User Types associated to Organization/User associations |
@@ -281,8 +281,8 @@ |
||
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | /** |
| 284 | - * @param UserTypeAssociation|UserType|int|array|null $object |
|
| 285 | - * @return int|null |
|
| 284 | + * @param UserAssociation $object |
|
| 285 | + * @return string |
|
| 286 | 286 | */ |
| 287 | 287 | protected function findKey($object = null) |
| 288 | 288 | { |
@@ -8,8 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace flipbox\organizations\objects; |
| 10 | 10 | |
| 11 | -use Craft; |
|
| 12 | -use flipbox\craft\ember\helpers\ObjectHelper; |
|
| 13 | 11 | use flipbox\organizations\elements\Organization; |
| 14 | 12 | |
| 15 | 13 | /** |
@@ -14,10 +14,10 @@ |
||
| 14 | 14 | use flipbox\craft\ember\records\IdAttributeTrait; |
| 15 | 15 | use flipbox\craft\ember\records\SortableTrait; |
| 16 | 16 | use flipbox\craft\ember\records\UserAttributeTrait; |
| 17 | -use flipbox\organizations\relationships\RelationshipInterface; |
|
| 18 | -use flipbox\organizations\relationships\UserTypeRelationship; |
|
| 19 | 17 | use flipbox\organizations\Organizations; |
| 20 | 18 | use flipbox\organizations\queries\UserAssociationQuery; |
| 19 | +use flipbox\organizations\relationships\RelationshipInterface; |
|
| 20 | +use flipbox\organizations\relationships\UserTypeRelationship; |
|
| 21 | 21 | use yii\db\ActiveQueryInterface; |
| 22 | 22 | use yii\helpers\Json; |
| 23 | 23 | |
@@ -32,7 +32,6 @@ |
||
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @inheritdoc |
| 35 | - * @param UserAssociation $record |
|
| 36 | 35 | * @return bool |
| 37 | 36 | */ |
| 38 | 37 | protected function performAction(UserAssociation $association): bool |