Skip to content

Instantly share code, notes, and snippets.

<?php
class Committee
{
protected $id;
protected $shortName;
protected $longName;
}
class Proposal
@jschroed91
jschroed91 / .scrutinizer.yml
Created August 10, 2015 13:55
.scrutinizer.yml for cdpaccess
imports:
- php
tools:
js_hint: true
php_code_sniffer: true
php_cs_fixer:
config: { level: psr2 }
enabled: true
build:
dependencies:
@jschroed91
jschroed91 / NEW TEXT
Created July 6, 2015 18:35
Diffing example ICC-3996
<p>Delayed egress locking systems shall be permitted to be installed on doors serving Group B, F, I, M, R, S and U occupancies in buildings that are equipped throughout with an <em>automatic sprinkler system</em> in accordance with Section 903.3.1.1 or an <em>approved</em> <em>automatic smoke</em> or <em>heat detection system</em> installed in accordance with Section 907. <br /><br /><strong>Exception:</strong> Delayed egress locking systems shall shall be permitted to be installed on doors serving Group E occupancies that have an occupant load of 10 or fewer and that are in buildings that are equipped throughout with an automatic sprinkler system in accordance with Section 903.3.1.1 or an approved automatic smoke or heat detection system installed in accordance with Section 907.</p>
<em>Spiral stairways</em> are permitted to be used as a component in the <em>means of egress</em> only within <em>dwelling units</em> or from a space not more than 250 square feet (23 m<sup>2</sup>) in area and serving not more than five occupants, or from <em>technical production areas</em> in accordance with Section 410.6.
<div class="secondParagraph">A <em>spiral stairway </em>shall have a&nbsp; &nbsp; &nbsp;6 3/4 inch (171 mm) minimum clear tread depth at a point 12 inches (305 mm) from the walkline. The risers shall be sufficient to provide a headroom of 78 inches (1981 mm) minimum, but riser height shall not be more than 91 /2 inches (241 mm). The minimum <em>stairway </em>clear width at and below the <em>handrail </em>shall be 26 inches (660 mm).</div>
public function preUp(Schema $schema)
{
parent::preUp($schema);
$this->addSql("CREATE TABLE cdp_timeline_link (id INT AUTO_INCREMENT NOT NULL, timeline_id INT DEFAULT NULL, action_button_text VARCHAR(50) NOT NULL, action_button_link VARCHAR(1024) NOT NULL, INDEX IDX_4BF3B3F6EDBEDD37 (timeline_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
$this->addSql("ALTER TABLE cdp_timeline_link ADD CONSTRAINT FK_4BF3B3F6EDBEDD37 FOREIGN KEY (timeline_id) REFERENCES cdp_timeline (id) ON DELETE CASCADE");
}
public function up(Schema $schema)
{
$subQuery = $this->getEntityManager()->createQueryBuilder();
$subQuery->select('relatedBallot.id')
->from('ProposalBundle:FloorModifiedProposal', 'floorModifiedProposal')
->join('floorModifiedProposal.ballotsRelatedToMe', 'relatedBallot')
->where($subQuery->expr()->eq('floorModifiedProposal.id', ':floorModifiedProposalId'));
$qb->andWhere($qb->expr()->notIn('fmps.id', $subQuery->getDQL()))
->setParameter('floorModifiedProposalId', $floorModifiedProposalId);
if (is_string($proposal)) {
$className = '\Caxy\ProposalBundle\Entity\\' . $proposal;
if (!class_exists($className)) {
return false;
}
$class = new \ReflectionClass($className);
$statuses = $class->getStatusPropertyValue('statuses');
}
{% extends ':cdp:base.html.twig' %}
{% block stylesheets %}
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" />
{% stylesheets
'../app/Resources/public/cdp/css/base.css'
'../vendor/isteven/angular-multi-select/angular-multi-select.css'
filter='cssrewrite'
%}
<link rel="stylesheet" href="{{ asset_url }}" />
public function canReattach()
{
$filterFunction = function ($collaborator) {
return in_array($collaborator->getRole()->getName(), array(Role::PROPONENT, coproponent)) && $collaborator->getStatus()->getName() == CollaboratorStatus::ACCEPTED;
});
$parentCollaborators = $this->getParentProposal()->getCollaborators()->filter($filterFunction);
$childCollaborators = $this->getProposal()->getCollaborators()->filter($filterFunction);
if ($parentCollaborators->count() !== $childCollaborators->count()) {
return false;
if (!$image ||
!(
$objectsManager->isEntityOnProposal($image->getSection(), $proposal) ||
$image instanceof Figure ? $objectsManager->isEntityOnProposal($image, $proposal) : false
)
) {