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
plugins { | |
id 'org.jetbrains.kotlin.jvm' | |
} | |
apply plugin: 'java-library' | |
dependencies { | |
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | |
api "io.reactivex.rxjava2:rxjava:$rx_java_version" | |
} |
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
class AppActivity { | |
.... | |
override fun exec(command: UiCommand) { | |
when (command) { | |
is UiCommand.CloseLeftMenu -> closeLeftMenu() | |
is UiCommand.DisplayShopData -> displayShopData(command.shop) | |
is UiCommand.DisplayUserData -> setUser(command.user) | |
is UiCommand.ResetView -> resetView() | |
is UiCommand.ShowSplashScreen -> showSplashScreen(command.text) |
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
class CityRepository @Inject constructor( | |
private val publicApi: PublicApi, | |
private val pool: SchedulersPool | |
) { | |
protected val parser = CriteriaParser() | |
fun getCities(criteria: Criteria): Single<CityCollection> { | |
return publicApi | |
.let { | |
if (criteria.page.isEmpty()) { | |
it.getCities(toQueryMap(criteria)) |
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
override fun panToBounds() { | |
val isSingleMarker = markerToShopStorage.count() == 1 | |
try { | |
val move: CameraUpdate = when { | |
isSingleMarker -> CameraUpdateFactory.newLatLngZoom(boundsBuilder.build().center, 12f) | |
else -> { | |
val padding = 200 | |
CameraUpdateFactory.newLatLngBounds(boundsBuilder.build(), padding) | |
} | |
} |
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
<?php | |
class BusinessTransactionHandler{ | |
public function persistOrder( Order $order, EntityManager $em ) { | |
$em->beginTransaction(); | |
try { | |
$counter = $em->find( "AppBundle:ShopOrderCounter", | |
$order->getShop() | |
->getOrderCounter() | |
->getId(), |
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
<?php | |
/** | |
* Date: 02.03.2018 | |
* Time: 0:16 | |
*/ | |
use Doctrine\Common\Collections\Criteria; | |
use Doctrine\Common\Collections\Expr\CompositeExpression; | |
use Doctrine\Common\Collections\Expr\Expression; | |
use Doctrine\Common\Collections\ExpressionBuilder; |
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
<?php | |
namespace AppBundle\Rest\Request; | |
use AppBundle\Validator\Constraints\Subset; | |
use JMS\Serializer\Annotation as Serializer; | |
use Symfony\Component\Validator\Constraints as Assert; | |
/** | |
* Class CreateProductRequest |