Skip to content

Instantly share code, notes, and snippets.

$query = $articles->find()
->where(['title LIKE' => '%First%'])
->andWhere(function ($exp) {
return $exp->or_([
'author_id' => 2,
'is_highlighted' => true
]);
});
<?php
namespace App\Mailer\Preview;
use Cake\Core\Configure;
use Cake\ORM\Locator\LocatorAwareTrait;
use DebugKit\Mailer\MailPreview;
class UsersMailPreview extends MailPreview
{
use LocatorAwareTrait;
{
"require": {
"sdevore/cakephp-scid-plugin": "dev-feature/bootstrap-4",
},
"repositories": [
{
"type": "vcs",
"url": "[email protected]:sdevore/cakephp-scid-plugin.git"
},
],
@sdevore
sdevore / Comment.js
Created November 27, 2019 21:23 — forked from JamesRagonesi/Comment.js
Reusable Forms - Model
import { Model } from "@vuex-orm/core";
import { required, maxLength, minLength } from "vuelidate/lib/validators";
export default class Comment extends Model {
static fields() {
return {
id: this.attr(null),
text: this.string(""),
};
}
@sdevore
sdevore / CommentForm.vue
Created November 27, 2019 21:23 — forked from JamesRagonesi/CommentForm.vue
Reusable form with Vuex ORM
<form v-model="$v.valid" @submit.prevent="submit">
<input
type="text"
v-model.trim="$v.form.text.$model"
@input="$v.form.text.$touch()"
@blur="$v.form.text.$touch()"
/>
<button @click="submit">Submit</button>
</form>
@sdevore
sdevore / UnitModel.js
Last active July 8, 2021 17:48
how is available defined
get available () {
const status = this.status.toLowerCase()
// if the date is essentially empty then
if (['', '0000-00-00'].includes(this.when_available.trim())) {
// if the status contains `not ready` then show `Coming Soon`
if (status.indexOf('not ready') !== -1) {
return 'Coming Soon'
}
// other wise it is `Available`
return 'Available'