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 Com\Company\System; | |
use \Com\Company\Interfaces; | |
class VerifyHelper | |
{ | |
/** |
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 | |
function solution($A) | |
{ | |
$sum = 0; | |
while (count($A)) { | |
// remove the last part | |
array_pop($A); |
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 | |
function solution($K, $L, $M, $N, $P, $Q, $R, $S) { | |
//get inputs to check intersection | |
$leftSide = max($K, $P); | |
$rightSide = min($M, $R); | |
$bottomSide = max($L, $Q); | |
$topSide = min($N, $S); | |
//the area of the sum of the rectangles | |
$sum = (($M - $K) * ($N - $L)) + (($R - $P) * ($S - $Q)); |
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 | |
function test($v, $arr1) { | |
$arr2 = []; | |
while(1){ | |
$count1 = isset(array_count_values($arr1)[$v]) ? array_count_values($arr1)[$v] : 0; | |
$count2 = isset(array_count_values($arr2)[$v]) ? array_count_values($arr2)[$v] : 0; | |
if(count($arr1) == 0 || $count1 == count($arr2) - $count2) { | |
return count($arr1); | |
} | |
$arr2[] = array_shift($arr1); |
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 | |
function solution($X, $A) { | |
foreach ($A as $key => $value) { | |
$part1 = array_slice($A, 0, $key); | |
$part2 = array_slice($A, $key, count($A) - 1); | |
$arrayPart1Indexes = array(); | |
$arrayPart2Indexes = array(); | |
foreach ($part1 as $part1key => $part1Value) { |
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 | |
$dataArray = array('nome_vendedor' => $this->proposta->vendedor->nome, | |
'nome_comprador' => $this->proposta->comprador->nome, | |
'proposta' => $this->proposta->mensagem, | |
'mensagem' => $request->input("resposta"), | |
'linkAnuncio' => url('anuncio/'.$this->proposta->anuncio->slug)); | |
$email_comprador = $this->proposta->comprador->email; | |
Mail::send('email.responderProposta', $dataArray, function ($m) use ($email_comprador) { |
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
$dataArray = array('nome_vendedor' => $this->proposta->vendedor->nome, | |
'nome_comprador' => $this->proposta->comprador->nome, | |
'proposta' => $this->proposta->mensagem, | |
'mensagem' => $request->input("resposta"), | |
'linkAnuncio' => url('anuncio/'.$this->proposta->anuncio->slug)); | |
$email_comprador = $this->proposta->comprador->email; | |
Mail::send('email.responderProposta', $dataArray, function ($m) use ($email_comprador) { | |
$m->from('[email protected]', 'BidCarros Portal'); |
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 | |
/** | |
* @author Gabriel P. Fiel <[email protected]> | |
*/ | |
namespace Application\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Gedmo\Mapping\Annotation as Gedmo; | |
use Application\Interfaces\SoftDeleteInterface; |
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 | |
/** | |
* Persistir o objeto da mensagem, verifica se irá alterar ou cadastrar | |
* @param EntityManager $em | |
* @param Resposta &$objResposta | |
* @return Array Dados necessários para o registro do log | |
*/ | |
public function persistir(EntityManager $em, Resposta &$objResposta) | |
{ |
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 Admin\Form; | |
use Zend\Form\Form; | |
use Zend\InputFilter\InputFilterProviderInterface; | |
class GaleriaForm extends Form implements InputFilterProviderInterface | |
{ | |
public function init() | |
{ |
NewerOlder