-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
576 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace AmoCRM\Collections; | ||
|
||
use AmoCRM\Models\FileLinkModel; | ||
|
||
/** | ||
* Class LinksCollection | ||
* | ||
* @package AmoCRM\Collections | ||
* | ||
* @method null|FileLinkModel current() | ||
* @method null|FileLinkModel last() | ||
* @method null|FileLinkModel first() | ||
* @method null|FileLinkModel offsetGet($offset) | ||
* @method void offsetSet($offset, FileLinkModel $value) | ||
* @method FileLinksCollection prepend(FileLinkModel $value) | ||
* @method FileLinksCollection add(FileLinkModel $value) | ||
* @method null|FileLinkModel getBy($key, $value) | ||
*/ | ||
class FileLinksCollection extends BaseApiCollection | ||
{ | ||
/** | ||
* Класс модели | ||
* @var string | ||
*/ | ||
public const ITEM_CLASS = FileLinkModel::class; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/AmoCRM/EntitiesServices/BaseEntityTypeEntityIdEntity.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace AmoCRM\EntitiesServices; | ||
|
||
use AmoCRM\Exceptions\InvalidArgumentException; | ||
|
||
/** | ||
* Class BaseEntityTypeEntityIdEntity | ||
* | ||
* @package AmoCRM\EntitiesServices | ||
*/ | ||
abstract class BaseEntityTypeEntityIdEntity extends BaseEntityIdEntity | ||
{ | ||
protected $entityType = ''; | ||
|
||
/** | ||
* @param string $entityType | ||
* | ||
* @return string | ||
* @throws InvalidArgumentException | ||
*/ | ||
abstract protected function validateEntityType(string $entityType): string; | ||
|
||
/** | ||
* @param string $entityType | ||
* @return $this | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function setEntityType(string $entityType): self | ||
{ | ||
$entityType = $this->validateEntityType($entityType); | ||
$this->entityType = $entityType; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getEntityType(): string | ||
{ | ||
return $this->entityType; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod(): string | ||
{ | ||
return sprintf($this->method, $this->getEntityType(), $this->getEntityId()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.