This file contains hidden or 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 Imoveis\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Zend\Stdlib\Hydrator; | |
/** | |
* Bairros | |
* |
This file contains hidden or 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
- Entidades Relacionadas | |
Inserir a anotação | fetch="EAGER" | no item de relacionamento, | |
para carregar automaticamente o objeto. | |
Ex: | |
/** | |
* @ORM\OneToMany(targetEntity="Clientes\Entity\PedidosItens", mappedBy="pedido", fetch="EAGER") | |
*/ | |
private $itens; |
This file contains hidden or 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 | |
$formCampos = $form->get('fieldset_princpal'); | |
$collectionElement = $formCampos->get('collection_element'); | |
?> | |
<?php $campoTipo = $collectionElement->getFieldsets()[0]->getElements()['nomeCampo']; ?> |
This file contains hidden or 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 | |
$dataOperacao = '2013-12-23 15:16:17'; | |
$format = 'Y-m-d H:i:s'; | |
$date = DateTime::createFromFormat($format, $dataOperacao); | |
$date->add(new DateInterval('P365D')); | |
echo $date->format('Y-m-d') . "\n"; | |
/** | |
* lê-se os argumentos de DateInterval da seguinte forma: periodo de 365 dias (period of 365 days) |
This file contains hidden or 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 | |
// Onde $this->em recebe o EntityManager | |
$sql = 'SELECT id,titulo FROM posts'; | |
$stmt = $this->em->getConnection()->prepare($sqlSlug); | |
$stmt->bindValue(1, $slugPost); | |
try { | |
$stmt->execute(); |
This file contains hidden or 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 | |
// use para classe doctrine | |
use Doctrine\ORM\Query\ResultSetMappingBuilder; | |
// código no método de consulta | |
$sql = " SELECT p.* " . | |
" FROM posts p ". | |
" INNER JOIN post_categories_has_posts pcp ON pcp.posts_id = p.id ". |
This file contains hidden or 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 | |
public function testIfSetsVariablesInRequestABudgetAction() | |
{ | |
$this->createMocks(); // create mocks for services | |
$this->dispatch('/en/contact/request-a-budget'); | |
$this->assertResponseStatusCode(200); | |
$viewManager = $this->getApplicationServiceLocator()->get('ViewManager'); | |
$variables = $viewManager->getViewModel()->getChildren()[0]->getVariables(); |
This file contains hidden or 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
Script para testar SDK do Facebook: | |
1 - Baixar SDK e importar para o Eclipse | |
2 - Nos projetos de exemplo, excluir a pasta libs | |
3 - Em propriedades -> Android, incluir o Facebook como uma lib | |
Link de referência: | |
http://stackoverflow.com/questions/20399836/friendpickersample-installation-failed-due-to-invalid-apk-file-friendpickersa |
This file contains hidden or 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
// With Jquery | |
$(function() { | |
$("#canvas").click(); // simulate click in canvas element | |
}); | |
// Or pure javascript | |
window.onload = function() { | |
var canvasElm = document.getElementById('canvas'); | |
canvasElm.setAttribute('tabindex','0'); | |
canvasElm.focus(); |
This file contains hidden or 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
recyclerView = (RecyclerView) findViewById(R.id.rvMessagesList); | |
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(MessageThreadActivity.this); | |
linearLayoutManager.setStackFromEnd(true); | |
linearLayoutManager.setReverseLayout(false); | |
recyclerView.setLayoutManager(linearLayoutManager); |
OlderNewer