当前位置: 首页>>代码示例>>PHP>>正文


PHP Movie::getId方法代码示例

本文整理汇总了PHP中Movie::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Movie::getId方法的具体用法?PHP Movie::getId怎么用?PHP Movie::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Movie的用法示例。


在下文中一共展示了Movie::getId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 public function save(Movie $movie)
 {
     $commentData = array('mov_id' => $movie->getcategory()->getId(), 'mov_description_short' => $movie->getMovie());
     if ($movie->getId()) {
         $this->getDb()->update('movie', $movieData, array('mov_id' => $movie->getId()));
     } else {
         $this->getDb()->insert('mov', $movieData);
         $id = $this->getDb()->lastInsertId();
         $movie->setId($id);
     }
 }
开发者ID:DorianeV,项目名称:MyMovies,代码行数:11,代码来源:CategoryDAO.php

示例2: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Movie $value A Movie object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Movie $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
开发者ID:redandpink,项目名称:h-emergenze,代码行数:22,代码来源:BaseMoviePeer.php

示例3: setMovie

 /**
  * Declares an association between this object and a Movie object.
  *
  * @param      Movie $v
  * @return     MovieI18n The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setMovie(Movie $v = null)
 {
     if ($v === null) {
         $this->setId(NULL);
     } else {
         $this->setId($v->getId());
     }
     $this->aMovie = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Movie object, it will not be re-added.
     if ($v !== null) {
         $v->addMovieI18n($this);
     }
     return $this;
 }
开发者ID:br00k,项目名称:yavom,代码行数:22,代码来源:BaseMovieI18n.php

示例4: prune

 /**
  * Exclude object from result
  *
  * @param     Movie $movie Object to remove from the list of results
  *
  * @return    MovieQuery The current query, for fluid interface
  */
 public function prune($movie = null)
 {
     if ($movie) {
         $this->addUsingAlias(MoviePeer::ID, $movie->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
开发者ID:rubensayshi,项目名称:propelsandbox,代码行数:14,代码来源:BaseMovieQuery.php

示例5: filterByMovie

 /**
  * Filter the query by a related Movie object
  *
  * @param     Movie|PropelCollection $movie The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    MoviesgenresQuery The current query, for fluid interface
  */
 public function filterByMovie($movie, $comparison = null)
 {
     if ($movie instanceof Movie) {
         return $this->addUsingAlias(MoviesgenresPeer::MOVIEID, $movie->getId(), $comparison);
     } elseif ($movie instanceof PropelCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(MoviesgenresPeer::MOVIEID, $movie->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByMovie() only accepts arguments of type Movie or PropelCollection');
     }
 }
开发者ID:rubensayshi,项目名称:propelsandbox,代码行数:21,代码来源:BaseMoviesgenresQuery.php

示例6: getMovieTrackList

 /**
  * Gets movie tracks list to be played.
  * Used in /movie/showSuccess
  *
  * @param Movie $movie
  * @return Array $tracks_list
  */
 public static function getMovieTrackList($movie)
 {
     $item = array();
     $item['id'] = $movie->getId();
     $item['cover'] = str_replace("'", ''', $movie->getCoverShow());
     $item['title'] = str_replace("'", ''', $movie->getTitle());
     foreach ($movie['AudioTracks'] as $track) {
         $item2 = array();
         $item2['code'] = $track['code'];
         $item2['codec'] = $track['codec'];
         $item2['flag'] = $track['flag'];
         $item['audio_tracks'][] = $item2;
     }
     foreach ($movie['SubTracks'] as $track) {
         $item2 = array();
         $item2['label'] = $track['label'];
         $item2['code'] = $track['code'];
         $item2['flag'] = $track['flag'];
         $item['sub_tracks'][] = $item2;
     }
     $item['file_rel'] = $movie->getFileRel();
     $tracks_list[] = $item;
     return $tracks_list;
 }
开发者ID:nass600,项目名称:homeCENTER,代码行数:31,代码来源:util.php

示例7: updateMovie

 public function updateMovie(Movie $movie)
 {
     $this->connect();
     // disable auto commit, so that we can roll back bridge table deletes if
     // the transaction fails in the second portion of the query
     mysqli_autocommit($this->link, FALSE);
     // first, we delete all records in the actor bridge table for the movie
     $sqlDelete = "DELETE FROM actor WHERE movie_id = " . $movie->getId();
     try {
         if (mysqli_query($this->link, $sqlDelete)) {
             // now that the bridge table is cleared out, update the movie
             $movieId = $movie->getId();
             $directorId = $movie->getDirector()->getId();
             $title = "'" . mysqli_real_escape_string($this->link, $movie->getTitle()) . "'";
             $releaseDate = "'" . $movie->getReleaseDate() . "'";
             $synopsis = "'" . mysqli_real_escape_string($this->link, $movie->getSynopsis()) . "'";
             $sqlUpdate = "UPDATE movie " . "SET director_id = {$directorId}, " . "title = {$title}, " . "release_date = {$releaseDate}, " . "submit_date = CURDATE(), " . "synopsis = {$synopsis} " . "WHERE id = {$movieId}";
             if (mysqli_query($this->link, $sqlUpdate)) {
                 // alright, movie table is updated, now to re-enter the new
                 // actor list into the bridge table.
                 $callback = function ($person) use($movieId) {
                     if ($person instanceof Person) {
                         $personId = $person->getId();
                         return "({$movieId}, {$personId})";
                     } else {
                         return "";
                     }
                 };
                 $bridgePairs = array_map($callback, $movie->getActors());
                 $values = implode(", ", $bridgePairs);
                 $bridgeSql = "INSERT INTO actor (movie_id, people_id) VALUES {$values}";
                 $result = mysqli_query($this->link, $bridgeSql);
                 if ($result) {
                     // ok, movie is update, and bridge table too
                     // now we can safely commit
                     mysqli_commit($this->link);
                     $this->disconnect();
                     return TRUE;
                 }
             } else {
                 // uh oh, something went wrong, roll back and abort!
                 mysqli_rollback($this->link);
                 $this->disconnect();
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     } catch (Exception $e) {
         mysqli_rollback($this->link);
         $this->disconnect();
         return FALSE;
     }
 }
开发者ID:ecs0,项目名称:tbmd.com,代码行数:54,代码来源:Connection.php


注:本文中的Movie::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。