Skip to content

Instantly share code, notes, and snippets.

View oaltman's full-sized avatar

Ondřej Altman oaltman

  • Emplifi
  • Pilsen, Czech Republic
View GitHub Profile
@oaltman
oaltman / gist:6522553
Created September 11, 2013 11:54
Entita + přidávání do kolekce + duplicitní záznamy
foreach($images as $image)
{
if(!$this->show->hasImage($image)) $this->show->addImage($image);
}
$query = $qb->select(array('draft' => 'draft','thumbnail' => 'thumbnail'))
->from('App\Thumbnail\Thumbnail', 'thumbnail')
->from('App\Cropper\Image', 'image')
->from('App\Article\Draft', 'draft')
->where('thumbnail.image = image')
->andWhere('draft.image = image')
->getQuery();
return $query->execute();
abstract class ContentDao extends EntityDao
{
protected $imageType;
public function __construct($imageType)
{
$this->imageType = $imageType;
}
public function getImageType()
array $result (
array(
article => ArticleEntity,
thumbnail => ThumbnailEntity
),
array(
article => ArticleEntity,
thumbnail => ThumbnailEntity
),
array(
public function getUnpublished()
{
$qb = $this->createQueryBuilder();
$query = $qb->select(array('thumbnail','show'))
->from('\App\Thumbnail\Thumbnail','thumbnail')
->from('\App\Cropper\Image','image')
->from('\App\Entity\Content\Show', 'show')
->where('show.image = image')
->andWhere('thumbnail.image = image')
->getQuery();
nette:
mailer:
smtp:
email: smtp.live.com
username: user
password: heslo
port: 587
secure: tls
services:
/**
* @ORM\Entity(repositoryClass="ApplicantRepository")
*/
class Applicant extends BaseEntity
{
/** @var string
@ORM\Column(type="string") @ORM\Id*/
protected $email;
/**
$qb = $this->applicantRepository->createQueryBuilder()
->select('a','c','p')
->from('\App\model\entity\Applicant','a')
->leftJoin('\App\model\entity\Comment','c',Join::WITH,'c.applicant = a')
->leftJoin('\App\model\entity\Payment','p',Join::WITH,'p.applicant = a')
->getQuery();
return $qb->getResult();
$('.ajax-load').click ->
url = $(this).data 'url'
$.nette.ajax
url: url,
if(this.headerRenderers[key])
return this.headerRenderers[key](data);