| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\common\repositories\shared;
- use app\common\dao\shared\SharedProsperityRecommendConfigDao;
- use app\common\repositories\BaseRepository;
- use app\entity\data\shared\SharedProsperityRecommendConfigEntity;
- class SharedProsperityRecommendConfigRepository extends BaseRepository
- {
- protected $dao;
- /**
- * SharedProsperityUserRepository constructor.
- * @param SharedProsperityRecommendConfigDao $dao
- */
- public function __construct(SharedProsperityRecommendConfigDao $dao)
- {
- $this->dao = $dao;
- }
- public function create($data)
- {
- return $this->dao->create($data);
- }
- /**
- * @param SharedProsperityRecommendConfigEntity $sharedProsperityRecommendConfigEntity
- * @return SharedProsperityRecommendConfigEntity
- */
- public function createByEntity(SharedProsperityRecommendConfigEntity $sharedProsperityRecommendConfigEntity): SharedProsperityRecommendConfigEntity
- {
- $result = $this->create($sharedProsperityRecommendConfigEntity->toUnderlineArray())->toArray();
- /** @var SharedProsperityRecommendConfigEntity $entity */
- $entity = SharedProsperityRecommendConfigEntity::newInstance($result);
- return $entity;
- }
- }
|