コード例 #1
0
ファイル: PostProperty.php プロジェクト: vcorobceanu/WebAPL
 public static function getPostProperties($id)
 {
     if (isset(static::$properties[$id])) {
         return static::$properties[$id];
     }
     $list = PostPropertyRel::join(PostProperty::getTableName(), PostProperty::getField('id'), '=', PostPropertyRel::getField('post_property_id'))->where(PostPropertyRel::getField('post_id'), $id)->remember(SettingsModel::one('cachelife'))->get();
     $names = array();
     foreach ($list as $item) {
         $names[] = $item->key;
     }
     static::$properties[$id] = $names;
     return $names;
 }
コード例 #2
0
ファイル: Posts.php プロジェクト: hosivan90/toxotes
 protected function _afterDelete()
 {
     parent::_afterDelete();
     \PostImages::write()->delete(PostImages::getTableName())->where('`post_id`=:post_id')->setParameter(':post_id', $this->getId(), \PDO::PARAM_INT)->execute();
     \PostCustomFields::write()->delete(PostCustomFields::getTableName())->where('`post_id`=:post_id')->setParameter(':post_id', $this->getId(), \PDO::PARAM_INT)->execute();
     \PostAttachments::write()->delete(PostAttachments::getTableName())->where('`post_id`=:post_id')->setParameter(':post_id', $this->getId(), \PDO::PARAM_INT)->execute();
     \PostProperty::write()->delete(PostProperty::getTableName())->where('`post_id`=:post_id')->setParameter(':post_id', $this->getId(), \PDO::PARAM_INT)->execute();
 }