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
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(); |
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
array $result ( | |
array( | |
article => ArticleEntity, | |
thumbnail => ThumbnailEntity | |
), | |
array( | |
article => ArticleEntity, | |
thumbnail => ThumbnailEntity | |
), | |
array( |
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
abstract class ContentDao extends EntityDao | |
{ | |
protected $imageType; | |
public function __construct($imageType) | |
{ | |
$this->imageType = $imageType; | |
} | |
public function getImageType() |
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
$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(); |
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
foreach($images as $image) | |
{ | |
if(!$this->show->hasImage($image)) $this->show->addImage($image); | |
} |
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
class BaseEntity extends IdentifiedEntity { | |
public function __construct($data = NULL) | |
{ | |
parent::__construct(); | |
if($data) | |
$this->setData($data); | |
} | |
public function setData($data) |
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 | |
/** | |
* User: henry, Date: 7/31/13,Time: 12:11 AM | |
*/ | |
namespace App; | |
use Nette\Application\UI\Form; | |
class ArticleForm extends Form |
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
function .() { | |
set +o monitor | |
PORT=8888 | |
ADDRESS='localhost' | |
BROWSER="chromium-browser" | |
[[ -n "$1" ]] && PORT=$1 | |
[[ -n "$2" ]] && ADDRESS=$2 | |
[[ -n "$3" ]] && BROWSER=$3 | |
CURRENT=`pwd` | |
[[ ! -f "index.php" ]] && cd www |
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
$form->addTextarea("text", NULL) | |
->setAttribute('rows', 20) | |
->setAttribute('cols',60) | |
->getControlPrototype()->class("texyla"); |
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
public function testFormattingDatesBasedOnConfig() | |
{ | |
$stub = $this->getMock('Henry\Config',array('get')); | |
$stub->expects($this->any()) | |
->method('get') | |
->will($this->returnValue('c')); | |
$formatter = new DateFormatter($stub); | |
$this->assertEquals('c',$stub->get('param')); |