This file contains 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 Zsend; | |
use Zsend\Listener; | |
use Zend\Mvc\MvcEvent; | |
class Module | |
{ | |
public function getAutoloaderConfig() | |
{ | |
/** Autoloading config */ |
This file contains 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
{ | |
"name": "Your Application Name", | |
"description": "Application Description", | |
"license": "BSD-3-Clause", | |
"minimum-stability": "dev", | |
"repositories": [ | |
{ "type": "composer", | |
"url": "https://packages.zendframework.com" } | |
], | |
"require": { |
This file contains 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 | |
/** | |
* Activated modules. | |
*/ | |
return array( | |
'modules' => array( | |
'....' // Your existing appication modules | |
'ZF\Apigility', // Apigility modules. | |
'AssetManager', | |
'ZF\ApiProblem', |
This file contains 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 | |
return array( | |
'db' => array( | |
'driver' => 'Pdo', | |
'driver_options' => array( | |
1002 => 'SET NAMES \'UTF8\'', | |
), | |
'adapters' => array( | |
'Zdbtable' => array(), | |
), |
This file contains 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
private function setResetToken($accountid) { | |
try { | |
$token = uniqid().uniqid(); /** Generate a unique token */ | |
$tAccounts = new \Entity\Tables\tAccounts(); | |
$newReset = new \Entity\Tables\tAccountPasswordReset(); | |
$newReset->setTAccount($tAccounts); | |
$newReset->accountId = $accountid; | |
$newReset->resetToken = $token; | |
$this->entityManager->persist($newReset); | |
$this->entityManager->flush(); |
This file contains 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 Entity\Tables; | |
use Zend\InputFilter\InputFilterAwareInterface; | |
use Zend\InputFilter\InputFilterInterface; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity | |
*/ |
This file contains 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 Entity\Tables; | |
use Zend\InputFilter\InputFilterAwareInterface; | |
use Zend\InputFilter\InputFilterInterface; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity | |
*/ | |
class tAccountPasswordReset { |
This file contains 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 | |
/** Create an object of tAccounts */ | |
$account = $this->entityManager->getRepository('\Entity\Tables\tAccounts'); | |
/** Find a record */ | |
$record = $account->findOneBy(array('userEmail' => $email)); | |
if ($record) { | |
/** get all the records in the tAccountPasswordReset table that link via foreign key (accountId) */ | |
$resetRecords = $record->getPasswordResets(); | |
} |
This file contains 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 | |
$account = $this->entityManager->getRepository('\Entity\Tables\tAccounts'); | |
/** Find the account from tAccounts table */ | |
$record = $account->findOneBy(array('userEmail' => $email)); | |
if ($record) { // There is an active account for given email. | |
/** Generate a unique token */ | |
$token = uniqid().uniqid(); | |
/** create a new tAccountPasswordReset object and fill the info */ | |
$newReset = new \Entity\Tables\tAccountPasswordReset(); |
This file contains 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 | |
class yourclass implements ServiceLocatorAwareInterface | |
{ | |
protected $serviceLocator; | |
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) | |
{ | |
$this->serviceLocator = $serviceLocator; |
OlderNewer