Skip to content

Instantly share code, notes, and snippets.

View mockiemockiz's full-sized avatar

muhamad rifki mockiemockiz

View GitHub Profile
<?php
public function editModuleFile(){
$modulePath = './module/TestModule/module.php';
$getModuleContent = file_get_contents($modulePath);
$oldContent = $getModuleContent;
// find getServiceOcnfig(){ return array( 'factories' => array(
$getModuleContent = preg_replace_callback('/[public|protected]*? *?function *?getServiceConfig().*?{.*?return.*?array.*?\(.*?\'factories\'.*?array\(/s', function($macthes){
$string = $macthes[0];
$string .= "\n\t\t";
@mockiemockiz
mockiemockiz / gist:11398979
Last active August 29, 2015 14:00
fdgfdgdf
<?php
$cache = StorageFactory::adapterFactory('filesystem', array(
'cache_dir' => './data/cache',
'ttl' => 3600,
'plugins' => array(
'exception_handler' => array(
'throw_exceptions' => false
),
'serializer'
<?php
$select = new Select();
$select->from('real_estate_property')->columns(array('*'));
$select->join(
'real_estate_property_image',
"real_estate_property.id = real_estate_property_image.propertyId",
array('path'),
<?php
/**
* Created by PhpStorm.
* User: mockie
* Date: 4/10/14
* Time: 3:13 PM
*/
namespace RealEstate\Controller\Plugin;
@mockiemockiz
mockiemockiz / module.php
Last active August 29, 2015 14:01
moduile
<?php
namespace RealEstate;
use RealEstate\View\Helper\RealEstateHeadTitleHelper;
class Module
{
public function getAutoloaderConfig()
{
<?php
/**
* Created by PhpStorm.
* User: mockie
* Date: 4/29/14
* Time: 1:58 PM
*/
namespace RealEstate\View\Helper;
<?php
/**
* Created by PhpStorm.
* User: mockie
* Date: 5/10/14
* Time: 9:00 PM
*/
namespace User\Model;
<?php
/**
* Created by PhpStorm.
* User: mockie
* Date: 5/19/14
* Time: 7:54 PM
*/
namespace Property\Model;
$paginator = $this->getPropertyTable()->exploreProperty($cond);
$paginator->setCurrentPageNumber((int)$this->params()->fromQuery('page', 1));
$paginator->setItemCountPerPage(2);
return array('paginator' => $paginator);
<?php
public function indexAction()
{
$repository = $this->em->getRepository('UserDetail\Entity\UserCountry');
$adapter = new DoctrineAdapter(
new ORMPaginator(
$repository->createQueryBuilder('UserCountry')
->where('UserCountry.code=\'IDN\'')
->groupBy('UserCountry.code')