function bindPracticeFieldEntityArray($practiceFieldEntitys)
{
    $practiceFieldDtos = new PracticeFieldListDto();
    $practiceFieldDtoArray = array();
    foreach ($practiceFieldEntitys as $practiceFieldEntity => $value) {
        array_push($practiceFieldDtoArray, bindPracticeFieldEntity($value));
    }
    $practiceFieldDtos->setPracticeFields($practiceFieldDtoArray);
    return $practiceFieldDtos;
}
    $practiceFieldsArray = array();
    foreach ($practiceFieldListDto->getPracticeFields() as $practiceFieldDto) {
        $practiceFieldEntity = bindPracticeFieldDto($practiceFieldDto);
        $entityManager->persist($practiceFieldEntity);
        $entityManager->flush();
        array_push($practiceFieldsArray, bindPracticeFieldEntity($practiceFieldEntity));
    }
    $practiceFieldListDto = new PracticeFieldListDto();
    $practiceFieldListDto->setPracticeFields($practiceFieldsArray);
    $practiceFieldListDto->printData($app);
});
$app->put('/practicefields/:id', function ($id) use($app) {
    global $entityManager;
    $practiceFieldEntity = $entityManager->find("PracticeFieldEntity", $id);
    $entityManager->flush();
    $practiceFieldDto = bindPracticeFieldEntity($practiceFieldEntity);
    $practiceFieldDto->printData($app);
});
$app->delete('/practicefields/:id', function ($id) use($app) {
    global $entityManager;
    $practiceFieldEntity = $entityManager->find("PracticeFieldEntity", $id);
    $entityManager->remove($practiceFieldEntity);
    $entityManager->flush();
});
/*Referances*/
function getpracticeFieldQueryArray($app)
{
    $queryArray = array();
    $practiceFieldId = $app->request()->get('practiceFieldId');
    if ($practiceFieldId != null) {
        $queryArray['practiceFieldId'] = $practiceFieldId;